2 commits - java/code
by Partha Aji
java/code/src/com/redhat/rhn/common/security/acl/test/AccessTest.java | 8 +
java/code/src/com/redhat/rhn/domain/server/test/HostBuilder.java | 7 -
java/code/src/com/redhat/rhn/domain/server/test/ServerFactoryTest.java | 22 ++++-
java/code/src/com/redhat/rhn/domain/server/test/ServerGroupTest.java | 44 +++-------
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 16 ---
java/code/src/com/redhat/rhn/testing/ServerGroupTestUtils.java | 1
6 files changed, 46 insertions(+), 52 deletions(-)
New commits:
commit d6f6cea0cc6e3d4e4be88daa3aabf222be15ff76
Author: Partha Aji <paji(a)redhat.com>
Date: Tue Jun 29 15:32:06 2010 -0400
Fixed fve unit tests Hopefully...
diff --git a/java/code/src/com/redhat/rhn/common/security/acl/test/AccessTest.java b/java/code/src/com/redhat/rhn/common/security/acl/test/AccessTest.java
index a361e7d..d5d012c 100644
--- a/java/code/src/com/redhat/rhn/common/security/acl/test/AccessTest.java
+++ b/java/code/src/com/redhat/rhn/common/security/acl/test/AccessTest.java
@@ -36,6 +36,7 @@ import com.redhat.rhn.domain.user.legacy.UserImpl;
import com.redhat.rhn.testing.RhnBaseTestCase;
import com.redhat.rhn.testing.UserTestUtils;
+import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -218,9 +219,9 @@ public class AccessTest extends RhnBaseTestCase {
Server s = ServerFactoryTest.createTestServer(user, false,
ServerConstants.getServerGroupTypeMonitoringEntitled());
context.put("sid", new String[] {s.getId().toString()});
- boolean rc = acl.evalAcl(context, "system_feature(ftr_package_remove)");
+ boolean rc = acl.evalAcl(context, "system_feature(ftr_config)");
assertFalse(rc);
- rc = acl.evalAcl(context, "not system_feature(ftr_package_remove)");
+ rc = acl.evalAcl(context, "not system_feature(ftr_config)");
assertTrue(rc);
}
@@ -235,7 +236,8 @@ public class AccessTest extends RhnBaseTestCase {
context.put("user", user);
assertTrue(acl.evalAcl(context, "system_has_management_entitlement()"));
- s = ServerFactoryTest.createTestServer(user, true);
+ s = ServerFactoryTest.createUnentitledTestServer(user, true,
+ ServerFactoryTest.TYPE_SERVER_NORMAL, new Date());
context.put("sid", new String[] {s.getId().toString()});
assertFalse(acl.evalAcl(context, "system_has_management_entitlement()"));
diff --git a/java/code/src/com/redhat/rhn/domain/server/test/HostBuilder.java b/java/code/src/com/redhat/rhn/domain/server/test/HostBuilder.java
index c2b2b17..ab6920c 100644
--- a/java/code/src/com/redhat/rhn/domain/server/test/HostBuilder.java
+++ b/java/code/src/com/redhat/rhn/domain/server/test/HostBuilder.java
@@ -22,6 +22,7 @@ import com.redhat.rhn.domain.server.VirtualInstance;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.manager.entitlement.EntitlementManager;
import com.redhat.rhn.manager.system.SystemManager;
+import com.redhat.rhn.testing.RhnBaseTestCase;
import com.redhat.rhn.testing.TestUtils;
import org.hibernate.Session;
@@ -173,14 +174,14 @@ public class HostBuilder {
if (register) {
guest = ServerFactoryTest.createUnentitledTestServer(owner, true,
- ServerFactoryTest.TYPE_SERVER_NORMAL , new Date());
+ ServerFactoryTest.TYPE_SERVER_NORMAL, new Date());
+ RhnBaseTestCase.assertNotNull(guest);
virtualInstance.setGuestSystem(guest);
}
if (host != null) {
host.addGuest(virtualInstance);
- TestUtils.saveAndFlush(host);
+ HibernateFactory.getSession().save(host);
}
- TestUtils.saveAndFlush(guest);
guests.add(virtualInstance);
}
return guests;
diff --git a/java/code/src/com/redhat/rhn/domain/server/test/ServerFactoryTest.java b/java/code/src/com/redhat/rhn/domain/server/test/ServerFactoryTest.java
index 42ef538..30e2c0b 100644
--- a/java/code/src/com/redhat/rhn/domain/server/test/ServerFactoryTest.java
+++ b/java/code/src/com/redhat/rhn/domain/server/test/ServerFactoryTest.java
@@ -53,6 +53,7 @@ import com.redhat.rhn.domain.server.UndefinedCustomDataKeyException;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.domain.user.UserFactory;
import com.redhat.rhn.manager.entitlement.EntitlementManager;
+import com.redhat.rhn.manager.org.UpdateOrgSystemEntitlementsCommand;
import com.redhat.rhn.manager.rhnset.RhnSetDecl;
import com.redhat.rhn.manager.rhnset.RhnSetManager;
import com.redhat.rhn.manager.system.ServerGroupManager;
@@ -548,9 +549,26 @@ public class ServerFactoryTest extends RhnBaseTestCase {
Server newS = createUnentitledTestServer(owner, ensureOwnerAccess, stype,
dateCreated);
-
+
if (!type.getAssociatedEntitlement().isBase()) {
- SystemManager.entitleServer(newS, EntitlementManager.MANAGEMENT);
+ EntitlementServerGroup mgmt = ServerGroupFactory.lookupEntitled(
+ EntitlementManager.MANAGEMENT, owner.getOrg());
+ if (mgmt == null) {
+ assertNull(new UpdateOrgSystemEntitlementsCommand(
+ EntitlementManager.MANAGEMENT, owner.getOrg(), 10L).store());
+ newS = (Server)TestUtils.saveAndReload(newS);
+ mgmt = ServerGroupFactory.lookupEntitled(
+ EntitlementManager.MANAGEMENT,
+ owner.getOrg());
+ newS = ServerFactory.lookupById(newS.getId());
+ }
+ assertNotNull(mgmt);
+ assertNotNull(mgmt.getMaxMembers());
+ assertTrue(mgmt.getMaxMembers() > 0);
+ assertTrue(mgmt.getMaxMembers() - mgmt.getCurrentMembers() > 0);
+ assertNotNull(mgmt.getGroupType().getAssociatedEntitlement());
+ SystemManager.entitleServer(newS,
+ mgmt.getGroupType().getAssociatedEntitlement());
}
diff --git a/java/code/src/com/redhat/rhn/domain/server/test/ServerGroupTest.java b/java/code/src/com/redhat/rhn/domain/server/test/ServerGroupTest.java
index 10a13b7..f597748 100644
--- a/java/code/src/com/redhat/rhn/domain/server/test/ServerGroupTest.java
+++ b/java/code/src/com/redhat/rhn/domain/server/test/ServerGroupTest.java
@@ -14,8 +14,6 @@
*/
package com.redhat.rhn.domain.server.test;
-import com.redhat.rhn.common.db.datasource.ModeFactory;
-import com.redhat.rhn.common.db.datasource.WriteMode;
import com.redhat.rhn.common.hibernate.HibernateFactory;
import com.redhat.rhn.domain.org.Org;
import com.redhat.rhn.domain.role.RoleFactory;
@@ -25,6 +23,7 @@ import com.redhat.rhn.domain.server.ServerGroup;
import com.redhat.rhn.domain.server.ServerGroupFactory;
import com.redhat.rhn.domain.server.ServerGroupType;
import com.redhat.rhn.domain.user.User;
+import com.redhat.rhn.manager.org.UpdateOrgSystemEntitlementsCommand;
import com.redhat.rhn.testing.RhnBaseTestCase;
import com.redhat.rhn.testing.ServerGroupTestUtils;
import com.redhat.rhn.testing.TestUtils;
@@ -32,16 +31,12 @@ import com.redhat.rhn.testing.UserTestUtils;
import org.hibernate.Session;
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.Map;
-
/**
* ServerGroupTest
* @version $Rev$
*/
public class ServerGroupTest extends RhnBaseTestCase {
-
+ public static final long DEFAULT_MAX_MEMBERS = 10;
public void testEquals() throws Exception {
User user = UserTestUtils.findNewUser("testUser", "testorg");
@@ -85,37 +80,28 @@ public class ServerGroupTest extends RhnBaseTestCase {
return existingGroup;
}
else {
- EntitlementServerGroup group = new EntitlementServerGroup();
- group.setMaxMembers(new Long(10));
- group.setName(typeIn.getName());
- group.setDescription(typeIn.getName());
- group.setOrg(org);
- ServerGroupFactory.save(group);
- return updateGroupType(group, typeIn);
+ assertNull(new UpdateOrgSystemEntitlementsCommand(
+ typeIn.getAssociatedEntitlement(), org,
+ DEFAULT_MAX_MEMBERS).store());
+ EntitlementServerGroup group = ServerGroupFactory.lookupEntitled(
+ typeIn.getAssociatedEntitlement(), org);
+ assertNotNull(group);
+ assertNotNull(group.getMaxMembers());
+ assertTrue(group.getMaxMembers() > 0);
+ assertTrue(group.getMaxMembers() - group.getCurrentMembers() > 0);
+ assertNotNull(group.getGroupType().getAssociatedEntitlement());
+ return group;
}
}
- ManagedServerGroup sg = ServerGroupFactory.create("NewGroup",
+ ManagedServerGroup sg = ServerGroupFactory.create("NewGroup" +
+ TestUtils.randomString(),
"RHN Managed Group",
org);
assertNotNull(sg.getId());
return sg;
}
-
- private static EntitlementServerGroup updateGroupType(EntitlementServerGroup sg,
- ServerGroupType type)
- throws SQLException {
-
- WriteMode m = ModeFactory.getWriteMode("test_queries",
- "update_group_type");
- Map params = new HashMap();
- params.put("sgid", sg.getId());
- params.put("type_id", type.getId());
- m.executeUpdate(params);
- return (EntitlementServerGroup) TestUtils.reload(sg);
- }
-
public void testGetServerGroupTypeFeatures() throws Exception {
Org org1 = UserTestUtils.findNewOrg("testOrg");
assertTrue(org1.getEntitledServerGroups().size() > 0);
diff --git a/java/code/src/com/redhat/rhn/testing/ServerGroupTestUtils.java b/java/code/src/com/redhat/rhn/testing/ServerGroupTestUtils.java
index 4cc15e2..f42ccb4 100644
--- a/java/code/src/com/redhat/rhn/testing/ServerGroupTestUtils.java
+++ b/java/code/src/com/redhat/rhn/testing/ServerGroupTestUtils.java
@@ -74,5 +74,4 @@ public class ServerGroupTestUtils {
create(user, NAME + TestUtils.randomString(),
DESCRIPTION);
}
-
}
commit e5f2554bbc97d6892f8ddad781bc839852c68017
Author: Partha Aji <paji(a)redhat.com>
Date: Tue Jun 29 13:45:45 2010 -0400
Fixed a dupe key issue
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
index b317046..499fca3 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
@@ -4487,6 +4487,7 @@ button below, and <b>will be unable to log back in</b>.</source>
<source>Regular Usage</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/admin/multiorg/SoftwareEntitlements</context>
+ <context context-type="sourcefile">/rhn/admin/multiorg/OrgSoftwareSubscriptions</context>
</context-group>
</trans-unit>
<trans-unit id="Flex Counts">
@@ -4500,6 +4501,7 @@ button below, and <b>will be unable to log back in</b>.</source>
<source>Flex Usage</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/admin/multiorg/SoftwareEntitlements</context>
+ <context context-type="sourcefile">/rhn/admin/multiorg/OrgSoftwareSubscriptions</context>
</context-group>
</trans-unit>
@@ -4602,13 +4604,6 @@ deducted from the default organization.</source>
<context context-type="sourcefile">/rhn/admin/multiorg/OrgSoftwareSubscriptions</context>
</context-group>
</trans-unit>
-
- <trans-unit id="Regular Usage">
-<source>Regular Usage</source>
- <context-group name="ctx">
- <context context-type="sourcefile">/rhn/admin/multiorg/OrgSoftwareSubscriptions</context>
- </context-group>
- </trans-unit>
<trans-unit id="Regular Proposed Total">
<source>Regular Proposed Total</source>
@@ -4617,13 +4612,6 @@ deducted from the default organization.</source>
</context-group>
</trans-unit>
- <trans-unit id="Flex Usage">
-<source>Flex Usage</source>
- <context-group name="ctx">
- <context context-type="sourcefile">/rhn/admin/multiorg/OrgSoftwareSubscriptions</context>
- </context-group>
- </trans-unit>
-
<trans-unit id="Flex Proposed Total">
<source>Flex Proposed Total</source>
<context-group name="ctx">
13 years, 10 months
Branch 'yum-repo-sync' - java/code
by Shannon Hughes
java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java | 3 +--
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 3 +++
2 files changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 34190fd920f12cc1cb47fa19836eaf9c98d3f39f
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Tue Jun 29 14:54:55 2010 -0400
fix bug Validation i18n key
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java
index 620b34b..17b473e 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java
@@ -64,8 +64,7 @@ public class RepoDetailsAction extends RhnAction {
request.setAttribute(mapping.getParameter(), Boolean.TRUE);
if (ctx.isSubmitted()) {
-
-
+
ValidatorResult result = RhnValidationHelper.validate(this.getClass(),
makeValidationMap(form), null,
VALIDATION_XSD);
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
index 5bf9041..f0d7131 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
@@ -292,6 +292,9 @@ http://www.oasis-open.org/committees/xliff/documents/xliff-core-1.1.xsd"
<context context-type="sourcefile">Navigation Menu</context>
</context-group>
</trans-unit>
+ <trans-unit id="url">
+ <source>url</source>
+ </trans-unit>
<trans-unit id="alphabet">
<source>A B C D E F G H I J K L M N O P Q R S T U V W X Y Z</source>
<context-group name="ctx">
13 years, 10 months
Branch 'yum-repo-sync' - backend/satellite_tools java/code
by Shannon Hughes
backend/satellite_tools/reposync.py | 5 +----
java/code/src/com/redhat/rhn/taskomatic/task/RepoSyncTask.java | 2 +-
2 files changed, 2 insertions(+), 5 deletions(-)
New commits:
commit 8658ab4a0d01747750b516203422617fd949334b
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Tue Jun 29 13:17:45 2010 -0400
bug fixing for reposync
diff --git a/backend/satellite_tools/reposync.py b/backend/satellite_tools/reposync.py
index a93e924..1db732f 100644
--- a/backend/satellite_tools/reposync.py
+++ b/backend/satellite_tools/reposync.py
@@ -37,7 +37,6 @@ class RepoSync:
channel_label = None
channel = None
fail = False
- repo_label = None
quiet = False
def main(self):
@@ -95,7 +94,6 @@ class RepoSync:
self.type = options.type
self.channel_label = options.channel_label
self.fail = options.fail
- #self.repo_label = self.short_hash(self.url)
self.quiet = options.quiet
self.channel = self.load_channel()
@@ -104,8 +102,7 @@ class RepoSync:
sys.exit(1)
for url in self.urls:
- self.repo_label = self.short_hash(url)
- plugin = self.load_plugin()(url, self.channel_label + "-" + self.repo_label)
+ plugin = self.load_plugin()(url, self.channel_label)
self.import_packages(plugin, url)
self.print_msg("Sync complete")
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/RepoSyncTask.java b/java/code/src/com/redhat/rhn/taskomatic/task/RepoSyncTask.java
index 4f36783..70112da 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/RepoSyncTask.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/RepoSyncTask.java
@@ -106,7 +106,7 @@ public class RepoSyncTask implements Job {
cmd.add(c.getLabel());
cmd.add("--type");
cmd.add(ChannelFactory.CONTENT_SOURCE_TYPE_YUM.getLabel());
- cmd.add("--quiet");
+ cmd.add("--quiet");
return cmd;
}
13 years, 10 months
3 commits - backend/satellite_tools backend/wsgi scripts/setup-backend-devel.sh
by Justin Sherrill
backend/satellite_tools/satsync.py | 2 ++
backend/wsgi/wsgiRequest.py | 2 +-
scripts/setup-backend-devel.sh | 2 +-
3 files changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 8d6ddbb3bfcb35659073368880ca3fc27e630dc0
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Tue Jun 29 13:10:03 2010 -0400
fixing small issue with wsgi handler where status was not a string
diff --git a/backend/wsgi/wsgiRequest.py b/backend/wsgi/wsgiRequest.py
index ba33a81..9e4f93e 100644
--- a/backend/wsgi/wsgiRequest.py
+++ b/backend/wsgi/wsgiRequest.py
@@ -58,7 +58,7 @@ class WsgiRequest:
def send_http_header(self, status=None):
self.sent_header = 1
-
+ self.status = str(self.status)
if status is not None:
self.status = str(status)
if len(self.status) == 0 or self.status == None:
commit b74ae99b75c084b1ab69e97bc2a2e4798212fb6d
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Tue Jun 29 13:09:36 2010 -0400
adding removed option during alphabetization of command line arguments
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 8522a3b..b8ead93 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -2178,6 +2178,8 @@ def processCommandline():
help='override debug level set in /etc/rhn/rhn.conf (which is currently set at %s).' % CFG.DEBUG),
Option( '--dump-version', action='store',
help="requested version of XML dump (default: %s)" % constants.PROTOCOL_VERSION),
+ Option( '--email', action='store_true',
+ help='e-mail a report of what was synced/imported'),
Option( '--force-all-errata', action='store_true',
help='forcibly process all (not a diff of) errata metadata'),
Option( '--force-all-packages', action='store_true',
commit 04ceb29b5f3ee110e9dae47084da479e76ce6a2c
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Tue Jun 29 13:08:02 2010 -0400
adding wsgi to backend script
diff --git a/scripts/setup-backend-devel.sh b/scripts/setup-backend-devel.sh
index 1eec469..2ce6261 100755
--- a/scripts/setup-backend-devel.sh
+++ b/scripts/setup-backend-devel.sh
@@ -10,7 +10,7 @@ if [ ! -d /spacewalk ]; then
fi
cd /usr/share/rhn/
-DIRS="common satellite_exporter satellite_tools server spacewalk upload_server"
+DIRS="common satellite_exporter satellite_tools server spacewalk upload_server wsgi"
for dir in $DIRS; do
python /spacewalk/scripts/link-tree.py /spacewalk/backend/$dir /usr/share/rhn/$dir
13 years, 10 months
Changes to 'refs/tags/spacewalk-proxy-1.1.2-1'
by Miroslav Suchý
Tag 'spacewalk-proxy-1.1.2-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2010-06-29 13:59 +0000
Tagging package [spacewalk-proxy] version [1.1.2-1] in directory [proxy/proxy/].
Changes since spacewalk-backend-1.1.24-1:
Miroslav Suchý (3):
609040 - if we request checksum of file, do not sent Range http header
if file is rpm package, use checksum from db, otherwise read whole file
Automatic commit of package [spacewalk-proxy] release [1.1.2-1].
---
java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java | 25 ++++++----
proxy/proxy/apacheHandler.py | 3 -
proxy/proxy/spacewalk-proxy.spec | 5 +-
rel-eng/packages/spacewalk-proxy | 2
4 files changed, 22 insertions(+), 13 deletions(-)
---
13 years, 10 months
proxy/proxy rel-eng/packages
by Miroslav Suchý
proxy/proxy/spacewalk-proxy.spec | 5 ++++-
rel-eng/packages/spacewalk-proxy | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 61c76c81e54456b8ca3ad829368f7f446f532bf2
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Jun 29 15:59:09 2010 +0200
Automatic commit of package [spacewalk-proxy] release [1.1.2-1].
diff --git a/proxy/proxy/spacewalk-proxy.spec b/proxy/proxy/spacewalk-proxy.spec
index 400e45c..8bc6632 100644
--- a/proxy/proxy/spacewalk-proxy.spec
+++ b/proxy/proxy/spacewalk-proxy.spec
@@ -4,7 +4,7 @@ Group: Applications/Internet
License: GPLv2
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 1.1.1
+Version: 1.1.2
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: python
@@ -318,6 +318,9 @@ fi
%changelog
+* Tue Jun 29 2010 Miroslav Suchý <msuchy(a)redhat.com> 1.1.2-1
+- 609040 - if we request checksum of file, do not sent Range http header
+
* Mon Apr 19 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.1-1
- merge 2 duplicate byterange module to common.byterange
- bumping spec files to 1.1 packages
diff --git a/rel-eng/packages/spacewalk-proxy b/rel-eng/packages/spacewalk-proxy
index 8ee4788..2de9831 100644
--- a/rel-eng/packages/spacewalk-proxy
+++ b/rel-eng/packages/spacewalk-proxy
@@ -1 +1 @@
-1.1.1-1 proxy/proxy/
+1.1.2-1 proxy/proxy/
13 years, 10 months
2 commits - java/code proxy/proxy
by Miroslav Suchý
java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java | 25 ++++++----
proxy/proxy/apacheHandler.py | 3 -
2 files changed, 17 insertions(+), 11 deletions(-)
New commits:
commit 02e1328e9a50a9360c1904e8d5a78c0c46c5befc
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Jun 29 15:49:12 2010 +0200
if file is rpm package, use checksum from db, otherwise read whole file
diff --git a/java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java b/java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java
index f747bd9..a07ce16 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java
@@ -410,7 +410,7 @@ public class DownloadFile extends DownloadAction {
KickstartSession ksession = (KickstartSession) params.get(SESSION);
KickstartSessionState newState = null;
KickstartableTree tree = (KickstartableTree) params.get(TREE);
- Package rpmPackage;
+ Package rpmPackage = null;
Channel child = (Channel) params.get(CHILD);
if (tree.getBasePath().indexOf(kickstartMount) == 0) {
@@ -505,7 +505,7 @@ public class DownloadFile extends DownloadAction {
}
if (request.getMethod().equals("HEAD")) {
log.debug("Method is HEAD .. serving checksum");
- return manualServeChecksum(response, diskPath);
+ return manualServeChecksum(response, rpmPackage, diskPath);
}
else if (request.getHeader("Range") != null) {
log.debug("range detected. serving chunk of file");
@@ -565,19 +565,24 @@ public class DownloadFile extends DownloadAction {
// Ported from perl - needed for proxy support
private StreamInfo manualServeChecksum(HttpServletResponse response,
- String diskPath) throws IOException {
+ Package rpmPackage, String diskPath) throws IOException {
response.setContentType("application/octet-stream");
-
+ String checksum;
// Obtain the checksum for the file in question and stick it in the
// outgoing HTTP headers under "X-RHN-Checksum".
- File f = new File(diskPath);
- if (!f.exists()) {
- log.error("manualServeChecksum :: File not found: " + diskPath);
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- return getStreamForText("".getBytes());
+ if (rpmPackage != null && rpmPackage.getChecksum() != null &&
+ rpmPackage.getChecksum().getChecksum() != null) {
+ checksum = rpmPackage.getChecksum().getChecksum();
+ } else {
+ File f = new File(diskPath);
+ if (!f.exists()) {
+ log.error("manualServeChecksum :: File not found: " + diskPath);
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
+ return getStreamForText("".getBytes());
+ }
+ checksum = MD5Sum.getFileMD5Sum(f);
}
- String checksum = MD5Sum.getFileMD5Sum(f);
// Create some headers.
response.setContentLength(0);
response.addHeader("X-RHN-Checksum", checksum);
commit e783a6e7a1c329c0f2d9b64dadeaf6e26f5191cc
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Jun 29 13:19:24 2010 +0200
609040 - if we request checksum of file, do not sent Range http header
diff --git a/proxy/proxy/apacheHandler.py b/proxy/proxy/apacheHandler.py
index f233bd0..23216ed 100644
--- a/proxy/proxy/apacheHandler.py
+++ b/proxy/proxy/apacheHandler.py
@@ -238,7 +238,8 @@ class apacheHandler(rhnApache):
hdrs = UserDictCase()
for k in req.headers_in.keys():
- hdrs[k] = req.headers_in[k]
+ if k.lower() != 'range': # we want checksum of whole file
+ hdrs[k] = req.headers_in[k]
log_debug(9, "Using existing headers_in", hdrs)
connection.request("HEAD", pingURL, None, hdrs)
13 years, 10 months
Changes to 'refs/tags/spacewalk-backend-1.1.24-1'
by Jan Pazdziora
Tag 'spacewalk-backend-1.1.24-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2010-06-29 12:14 +0000
Tagging package [spacewalk-backend] version [1.1.24-1] in directory [backend/].
Changes since spacewalk-schema-1.1.5-1:
Jan Pazdziora (3):
Add initial support for anonymous PL/pgSQL blocks.
We want to pull the backend type from the config file as well.
Automatic commit of package [spacewalk-backend] release [1.1.24-1].
Justin Sherrill (11):
adding flex guest table changes
adding hibernate mapping for flex guests
first attempt at adding flex guest to sat cert processing
a few fixse for sat cert handling
matching hosteds column names for flex guests
few fixes for rhn cert activation, cert activation now works and populates max_members correctly, but not populating fve_max_members yet
having setters do the right thing
convertin rhn_entitlements.pkb to use four spaces instead of tabs
updating rhn_entitlement package for cert activation
adding flex guest detection at registration time
adding flex guest entitlement columns on the org entitlments page
Partha Aji (33):
Updated some views using hosted changes
Added rhnChannelFamilyServerFve in the hopes that it'll get used
Commiting the initial compilable merge of rhn_channel
Initial cut of the Flex Guests Page
Slight refactoring of Virtual Enttitlements
Added channel family permissions to upgrade
Added an rhnException data
Initial cut to list eligible flex guests page
Made the Flexguest page show entitlements
More UI updates on the Flex Guest Pages added Nav stuff
More updates to the UI
Removed unused stored procedures
Wiped out unused bulk procs
Added the convert to flex plsql operation
Forgot to commit EligibleFlexGuestAction
Added code to get multiorgs org -> software channel ents page work with flex entitlements
Fixed checkstyle errors
Added a couple of enhancements on the Org software subs pager
Updated the software entitlements page to deal with FVE
More verbiage on software entitlements page
Added alphabar columns for the mutli org pages
Added flex magic to ChannelFamily -> Orgs page
Added sorting to channel family-> orgs page
fixed a line typo where I forgot to clear the map create in session
Added page sizes to flex multiorg pages
Fixed some typos
Added unit tests for VirtEntitlementsManager
Added more tests on Orphaned gets entitlements
Fixed a compile error....
Consolidate virtual instance type changes to 1 file
added rhn channels and rhn_entitlements schema upgrade items
Updated the position of rhnPackageRepodata.sql to avoid conflict in naming
Fixed a goofed up merge for rhn_channel.pkb
---
backend/satellite_tools/satCerts.py | 1
backend/satellite_tools/sync_handlers.py | 95
backend/server/handlers/xmlrpc/registration.py | 44
backend/server/importlib/backend.py | 2
backend/server/importlib/importLib.py | 1
backend/server/rhnSQL/__init__.py | 9
backend/server/rhnSQL/driver_postgresql.py | 12
backend/server/rhnServer/satellite_cert.py | 2
backend/server/rhnVirtualization.py | 4
backend/spacewalk-backend.spec | 20
java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml | 52
java/code/src/com/redhat/rhn/common/db/datasource/xml/Org_queries.xml | 4
java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml | 58
java/code/src/com/redhat/rhn/domain/channel/ChannelFamily.java | 76
java/code/src/com/redhat/rhn/domain/channel/PrivateChannelFamily.hbm.xml | 3
java/code/src/com/redhat/rhn/domain/channel/PrivateChannelFamily.java | 35
java/code/src/com/redhat/rhn/domain/channel/test/ChannelFactoryTest.java | 27
java/code/src/com/redhat/rhn/domain/channel/test/ChannelFamilyFactoryTest.java | 17
java/code/src/com/redhat/rhn/domain/server/ServerGroupType.java | 10
java/code/src/com/redhat/rhn/domain/server/VirtualInstanceFactory.java | 78
java/code/src/com/redhat/rhn/domain/server/test/HostBuilder.java | 30
java/code/src/com/redhat/rhn/domain/server/test/ServerFactoryTest.java | 45
java/code/src/com/redhat/rhn/frontend/action/channel/ChannelEntitlementSetupAction.java | 39
java/code/src/com/redhat/rhn/frontend/action/multiorg/OrgNameFilter.java | 42
java/code/src/com/redhat/rhn/frontend/action/multiorg/OrgSoftwareSubscriptionsAction.java | 162
java/code/src/com/redhat/rhn/frontend/action/multiorg/SoftwareEntitlementSubscriptionsAction.java | 235 -
java/code/src/com/redhat/rhn/frontend/action/multiorg/SoftwareEntitlementsAction.java | 24
java/code/src/com/redhat/rhn/frontend/action/multiorg/SoftwareEntitlementsFilter.java | 42
java/code/src/com/redhat/rhn/frontend/action/systems/entitlements/EligibleFlexGuestAction.java | 89
java/code/src/com/redhat/rhn/frontend/action/systems/entitlements/FlexGuestAction.java | 60
java/code/src/com/redhat/rhn/frontend/dto/BaseDto.java | 35
java/code/src/com/redhat/rhn/frontend/dto/ChannelFamilySystem.java | 135
java/code/src/com/redhat/rhn/frontend/dto/ChannelFamilySystemGroup.java | 117
java/code/src/com/redhat/rhn/frontend/dto/ChannelOverview.java | 72
java/code/src/com/redhat/rhn/frontend/dto/MultiOrgEntitlementsDto.java | 75
java/code/src/com/redhat/rhn/frontend/dto/OrgChannelFamily.java | 88
java/code/src/com/redhat/rhn/frontend/dto/OrgSoftwareEntitlementDto.java | 128
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 14
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 193 +
java/code/src/com/redhat/rhn/frontend/struts/Expandable.java | 5
java/code/src/com/redhat/rhn/frontend/struts/SelectableAdapter.java | 55
java/code/src/com/redhat/rhn/frontend/taglibs/list/ColumnTag.java | 19
java/code/src/com/redhat/rhn/frontend/taglibs/list/row/DuplicateSystemsRowRenderer.java | 42
java/code/src/com/redhat/rhn/frontend/taglibs/list/row/ExpandableRowRenderer.java | 5
java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld | 5
java/code/src/com/redhat/rhn/frontend/xmlrpc/org/OrgHandler.java | 47
java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java | 90
java/code/src/com/redhat/rhn/manager/org/UpdateOrgSoftwareEntitlementsCommand.java | 108
java/code/src/com/redhat/rhn/manager/org/test/UpdateOrgSoftwareEntitlementsTest.java | 20
java/code/src/com/redhat/rhn/manager/system/SystemManager.java | 33
java/code/src/com/redhat/rhn/manager/system/VirtualizationEntitlementsManager.java | 46
java/code/src/com/redhat/rhn/manager/system/test/VirtualizationEntitlementsManagerTest.java | 219 +
java/code/src/com/redhat/rhn/testing/UserTestUtils.java | 14
java/code/webapp/WEB-INF/nav/sitenav-authenticated.xml | 7
java/code/webapp/WEB-INF/nav/virt_entitlements.xml | 7
java/code/webapp/WEB-INF/pages/admin/multiorg/orgsoftwaresubs.jsp | 115
java/code/webapp/WEB-INF/pages/admin/multiorg/softwareentitlements.jsp | 96
java/code/webapp/WEB-INF/pages/admin/multiorg/softwareentitlementsubs.jsp | 171
java/code/webapp/WEB-INF/pages/channel/entitlements.jsp | 60
java/code/webapp/WEB-INF/pages/systems/duplicate/duplicatesystems.jsp | 2
java/code/webapp/WEB-INF/pages/systems/entitlements/flexguests.jsp | 128
java/code/webapp/WEB-INF/struts-config.xml | 22
rel-eng/packages/spacewalk-backend | 2
schema/spacewalk/common/data/rhnException.sql | 6
schema/spacewalk/common/data/rhnVirtualInstanceType.sql | 11
schema/spacewalk/common/tables/rhnPrivateChannelFamily.sql | 4
schema/spacewalk/common/tables/rhnServerChannel.sql | 4
schema/spacewalk/common/views/rhnChannelFamilyOverview.sql | 2
schema/spacewalk/common/views/rhnChannelFamilyPermissions.sql | 4
schema/spacewalk/common/views/rhnChannelFamilyServerFve.sql | 34
schema/spacewalk/common/views/rhnChannelFamilyServerPhysical.sql | 1
schema/spacewalk/common/views/rhnChannelFamilyServerVirtual.sql | 1
schema/spacewalk/common/views/rhnOrgChannelFamilyPermissions.sql | 40
schema/spacewalk/oracle/packages/rhn_channel.pkb | 423 +-
schema/spacewalk/oracle/packages/rhn_channel.pks | 54
schema/spacewalk/oracle/packages/rhn_entitlements.pkb | 1460 ++++----
schema/spacewalk/oracle/packages/rhn_entitlements.pks | 13
schema/spacewalk/oracle/views/rhnOrgChannelFamilyPermissions.sql | 46
schema/spacewalk/postgres/packages/rhn_channel.pkb | 134
schema/spacewalk/postgres/views/rhnOrgChannelFamilyPermissions.sql | 36
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/003-rhnPackageRepodata.sql | 1
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/003-rhnPrivateChannelFamily.sql | 3
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/004-rhnServerChannel.sql | 4
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/005-rhnVirtualInstanceType.sql | 30
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/006-rhnChannelFamilyOverview.sql | 40
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/007-rhnOrgChannelFamilyPermissions.sql | 50
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/008-rhnChannelFamilyServerPhysical.sql | 52
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/009-rhnChannelFamilyServerVirtual.sql | 54
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/010-rhnChannelFamilyServerFve.sql | 34
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/011-rhnChannelFamilyPermissions.sql | 39
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/012-rhnException_data.sql | 26
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/014-rhn_channel-pks.sql | 54
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/015-rhn_channel-pkb.sql | 423 +-
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/016-rhn_entitlements-pks.sql | 225 +
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/017-rhn_entitlements-pkb.sql | 1762 ++++++++++
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/018-rhnPackageRepodata.sql | 1
web/html/javascript/multiorg-entitlements.js | 163
97 files changed, 6605 insertions(+), 2122 deletions(-)
---
13 years, 10 months
backend/spacewalk-backend.spec rel-eng/packages
by Jan Pazdziora
backend/spacewalk-backend.spec | 20 +++++++++++++++++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 20 insertions(+), 2 deletions(-)
New commits:
commit 73e5e464bbb7148bca724212d8330c563a811baa
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jun 29 14:14:15 2010 +0200
Automatic commit of package [spacewalk-backend] release [1.1.24-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index ebb38ab..d6ebfac 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -8,7 +8,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 1.1.23
+Version: 1.1.24
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -632,6 +632,24 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Tue Jun 29 2010 Jan Pazdziora 1.1.24-1
+- We want to pull the backend type from the config file as well.
+- Add initial support for anonymous PL/pgSQL blocks.
+- adding flex guest detection at registration time (jsherril(a)redhat.com)
+- few fixes for rhn cert activation, cert activation now works and populates
+ max_members correctly, but not populating fve_max_members yet
+ (jsherril(a)redhat.com)
+- a few fixse for sat cert handling (jsherril(a)redhat.com)
+- first attempt at adding flex guest to sat cert processing
+ (jsherril(a)redhat.com)
+- 608677 - export rhnChannelProduct information into a channel dump
+ (mzazrivec(a)redhat.com)
+- 608657 - if --consider-full is set, interpret disk dump as full export,
+ otherwise it is used as incremental dump (msuchy(a)redhat.com)
+- 608657 - add option --consider-full to man page of satellite-sync and to
+ output of --help (msuchy(a)redhat.com)
+- sort command line parameters alphabeticaly (msuchy(a)redhat.com)
+
* Mon Jun 28 2010 Jan Pazdziora 1.1.23-1
- Remove a debugging print.
- do need to check date, we can get anything (msuchy(a)redhat.com)
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 0910373..232ab8c 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.1.23-1 backend/
+1.1.24-1 backend/
13 years, 10 months
2 commits - backend/satellite_tools backend/server
by Jan Pazdziora
backend/satellite_tools/sync_handlers.py | 6 +++---
backend/server/rhnSQL/__init__.py | 9 ++++++---
backend/server/rhnSQL/driver_postgresql.py | 12 +++++++++++-
3 files changed, 20 insertions(+), 7 deletions(-)
New commits:
commit c75b9598e9830917bd7b332b89af86d0c13e1e9d
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jun 29 10:59:39 2010 +0200
We want to pull the backend type from the config file as well.
diff --git a/backend/server/rhnSQL/__init__.py b/backend/server/rhnSQL/__init__.py
index 661ec9f..12fe17f 100644
--- a/backend/server/rhnSQL/__init__.py
+++ b/backend/server/rhnSQL/__init__.py
@@ -67,7 +67,7 @@ def __init__DB(backend, host, port, username, password, database):
__DB.connect()
return 0
-def initDB(dsn=None, backend=ORACLE, host="localhost", port=None, username=None,
+def initDB(dsn=None, backend=None, host="localhost", port=None, username=None,
password=None, database=None):
"""
Initialize the database.
@@ -76,6 +76,9 @@ def initDB(dsn=None, backend=ORACLE, host="localhost", port=None, username=None,
password, and database. (sid in this case)
"""
+ if backend == None:
+ backend=CFG.DB_BACKEND
+
if not SUPPORTED_BACKENDS.has_key(backend):
raise rhnException("Unsupported database backend", backend)
commit 30903ca16fa55cab6994dbd97595eb549bd3f619
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Jun 25 16:13:28 2010 +0200
Add initial support for anonymous PL/pgSQL blocks.
We invoke them via functions that get created on the fly.
Use it for _query_update_family_counts.
diff --git a/backend/satellite_tools/sync_handlers.py b/backend/satellite_tools/sync_handlers.py
index aafb6af..5f55670 100644
--- a/backend/satellite_tools/sync_handlers.py
+++ b/backend/satellite_tools/sync_handlers.py
@@ -786,18 +786,18 @@ def purge_extra_channel_families():
_query_update_family_counts = rhnSQL.Statement("""
declare
- cursor ch_fam_cursor is
+ /*pg_cs*/ cursor ch_fam_cursor /*pg cursor*/ is
select cf.id channel_family_id, wc.id org_id
from rhnChannelFamily cf, web_customer wc;
begin
for row in ch_fam_cursor loop
- rhn_channel.update_family_counts(row.channel_family_id,
+ /*pg perform*/ rhn_channel.update_family_counts(row.channel_family_id,
row.org_id);
end loop;
end;
""")
def update_channel_family_counts():
- h = rhnSQL.prepare(_query_update_family_counts)
+ h = rhnSQL.prepare(_query_update_family_counts, params=())
h.execute()
rhnSQL.commit()
diff --git a/backend/server/rhnSQL/__init__.py b/backend/server/rhnSQL/__init__.py
index dea1bd3..661ec9f 100644
--- a/backend/server/rhnSQL/__init__.py
+++ b/backend/server/rhnSQL/__init__.py
@@ -180,11 +180,11 @@ def database():
def cursor():
db = __test_DB()
return db.cursor()
-def prepare(sql):
+def prepare(sql, params=None):
db = __test_DB()
if isinstance(sql, Statement):
sql = sql.statement
- return db.prepare(sql)
+ return db.prepare(sql, params=params)
def execute(sql, *args, **kwargs):
db = __test_DB()
return apply(db.execute, (sql, ) + args, kwargs)
diff --git a/backend/server/rhnSQL/driver_postgresql.py b/backend/server/rhnSQL/driver_postgresql.py
index 038048c..73b113f 100644
--- a/backend/server/rhnSQL/driver_postgresql.py
+++ b/backend/server/rhnSQL/driver_postgresql.py
@@ -21,6 +21,7 @@
import sys
import re
import pgsql
+import hashlib
import sql_base
from server import rhnSQL
@@ -193,7 +194,16 @@ class Database(sql_base.Database):
"Exception information: %s" % sys.exc_info()[1])
self.connect() # only allow one try
- def prepare(self, sql, force=0):
+ def prepare(self, sql, force=0, params=None):
+ if params != None: # support for anonymour plpgsql
+ sql = re.sub(r'/\*pg_cs\*/\s*cursor', '', sql)
+ sql = re.sub(r'/\*pg (.+?)\*/', '\g<1>', sql)
+ s = hashlib.new('sha1')
+ s.update(sql)
+ sha1 = s.hexdigest()
+ c = self.prepare("create function rhn_asdf_%s (%s) returns void as $%s$%s$%s$ language plpgsql" % ( sha1, ','.join(params), sha1, sql, sha1 ))
+ c.execute()
+ sql = "select rhn_asdf_%s()" % sha1
return Cursor(dbh=self.dbh, sql=sql, force=force)
def commit(self):
13 years, 10 months