Branch 'VADER' - 4 commits - java/code schema/spacewalk
by Justin Sherrill
java/code/src/com/redhat/rhn/common/db/datasource/xml/Action_queries.xml | 11
java/code/src/com/redhat/rhn/common/db/datasource/xml/SystemGroup_queries.xml | 18 -
java/code/src/com/redhat/rhn/domain/server/ServerFactory.java | 46 ---
java/code/src/com/redhat/rhn/domain/server/Server_legacyUser.hbm.xml | 41 +--
java/code/src/com/redhat/rhn/frontend/events/SsmInstallPackagesAction.java | 41 +--
java/code/src/com/redhat/rhn/frontend/events/SsmRemovePackagesAction.java | 36 +--
java/code/src/com/redhat/rhn/frontend/events/SsmUpgradePackagesAction.java | 21 -
java/code/src/com/redhat/rhn/manager/action/ActionManager.java | 117 ++++------
schema/spacewalk/upgrade/rhn-satellite-schema-5.1-to-spacewalk-schema-0.2 | 1
schema/spacewalk/upgrade/spacewalk-schema-0.2-to-spacewalk-schema-0.3 | 1
schema/spacewalk/upgrade/spacewalk-schema-0.3-to-spacewalk-schema-0.4 | 1
schema/spacewalk/upgrade/spacewalk-schema-0.4-to-spacewalk-schema-0.5 | 1
12 files changed, 130 insertions(+), 205 deletions(-)
New commits:
commit 888a0e3f95e3ee3f904def4d71b33d745a42d20e
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed Sep 30 11:31:33 2009 -0400
Revert "525549 - fixing issue where SSM package operations would run out of memory"
This reverts commit e312aadf24c0eba765fb16838ae1fdc908d91b9c.
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Action_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Action_queries.xml
index 1fbb305..32e63d1 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Action_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Action_queries.xml
@@ -294,15 +294,4 @@ SELECT 1
</query>
</mode>
-<write-mode name="insert_server_actions">
- <query params="parent_id, status_id, tries">
-INSERT INTO rhnServerAction (server_id, action_id, status, REMAINING_TRIES)
- select s.id as server_id, :parent_id as action_id,
- :status_id as status, :tries as REMAINING_TRIES
- from rhnServer s
- where s.id in (%s)
- </query>
-</write-mode>
-
-
</datasource_modes>
diff --git a/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java b/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
index 7ce8f0b..9f691e1 100644
--- a/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
@@ -39,7 +39,6 @@ import org.hibernate.Session;
import java.sql.Types;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
@@ -763,27 +762,4 @@ public class ServerFactory extends HibernateFactory {
"ServerSnapshot.findTags", params);
return snaps;
}
-
- /**
- * Filter out a list of systemIds with ones that are solaris systems
- * @param systemIds list of system ids
- * @return list of system ids that are solaris systems
- */
- public static List<Long> listSolarisSystems(Collection<Long> systemIds) {
- return ServerFactory.getSession().getNamedQuery("Server.listSolarisSystems").
- setParameterList("sids", systemIds).list();
- }
-
- /**
- * Filter out a list of systemIds with ones that are linux systems
- * (i.e. not solaris systems)
- * @param systemIds list of system ids
- * @return list of system ids that are linux systems
- */
- public static List<Long> listLinuxSystems(Collection<Long> systemIds) {
- return ServerFactory.getSession().getNamedQuery("Server.listRedHatSystems").
- setParameterList("sids", systemIds).list();
-
- }
-
}
diff --git a/java/code/src/com/redhat/rhn/domain/server/Server_legacyUser.hbm.xml b/java/code/src/com/redhat/rhn/domain/server/Server_legacyUser.hbm.xml
index d1ea620..0dbadcd 100644
--- a/java/code/src/com/redhat/rhn/domain/server/Server_legacyUser.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/server/Server_legacyUser.hbm.xml
@@ -89,36 +89,36 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
</set>
<many-to-one name="org" class="com.redhat.rhn.domain.org.OrgImpl"
- column="org_id" lazy="proxy"/>
+ column="org_id"/>
<many-to-one name="creator" class="com.redhat.rhn.domain.user.legacy.LegacyRhnUserImpl"
- column="creator_id" lazy="proxy"/>
+ column="creator_id"/>
<many-to-one name="serverArch"
class="com.redhat.rhn.domain.server.ServerArch"
- column="server_arch_id" lazy="proxy"/>
+ column="server_arch_id"/>
<many-to-one name="provisionState"
class="com.redhat.rhn.domain.common.ProvisionState"
- column="provision_state_id" cascade="save-update" lazy="proxy"/>
+ column="provision_state_id" cascade="save-update"/>
<one-to-one name="serverInfo"
- class="com.redhat.rhn.domain.server.ServerInfo" cascade="all" lazy="proxy"/>
+ class="com.redhat.rhn.domain.server.ServerInfo" cascade="all"/>
<one-to-one name="cpu" class="com.redhat.rhn.domain.server.CPU"
- property-ref="server" cascade="all" lazy="proxy"/>
+ property-ref="server" cascade="all"/>
<one-to-one name="lock" class="com.redhat.rhn.domain.server.ServerLock"
- cascade="all" lazy="proxy"/>
+ cascade="all"/>
<one-to-one name="serverUuid" class="com.redhat.rhn.domain.server.ServerUuid"
- cascade="all" lazy="proxy"/>
+ cascade="all"/>
<one-to-one name="proxyInfo" class="com.redhat.rhn.domain.server.ProxyInfo"
- cascade="all" lazy="proxy"/>
+ cascade="all"/>
<one-to-one name="pushClient" class="com.redhat.rhn.domain.server.PushClient"
- property-ref="server" lazy="proxy" />
+ property-ref="server" />
<!--
we want to access the ram object via the field directly.
@@ -127,16 +127,16 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
create a RAM object on a server.
-->
<one-to-one name="ram" class="com.redhat.rhn.domain.server.Ram"
- property-ref="server" cascade="all" access="field" lazy="proxy"/>
+ property-ref="server" cascade="all" access="field"/>
<one-to-one name="dmi" class="com.redhat.rhn.domain.server.Dmi"
- property-ref="server" cascade="all" lazy="proxy"/>
+ property-ref="server" cascade="all"/>
<one-to-one name="location" class="com.redhat.rhn.domain.server.Location"
- property-ref="server" cascade="all" lazy="proxy" />
+ property-ref="server" cascade="all"/>
<one-to-one name="virtualInstance"
class="com.redhat.rhn.domain.server.VirtualInstance"
property-ref="guestSystem"
- cascade="save-update" lazy="proxy"/>
+ cascade="save-update"/>
<set name="history" cascade="all" lazy="true" inverse="true">
<key column="server_id"/>
@@ -179,19 +179,6 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
<query name="Server.findByIdsAndOrgId">
<![CDATA[from com.redhat.rhn.domain.server.Server as s where ORG_ID = :orgId and s.id in (:serverIds)]]>
</query>
-
- <query name="Server.listRedHatSystems">
- <![CDATA[ select s.id
- from com.redhat.rhn.domain.server.Server as s
- where s.id in (:sids) and s.serverArch.archType.label != 'sysv-solaris']]>
- </query>
-
- <query name="Server.listSolarisSystems">
- <![CDATA[ select s.id
- from com.redhat.rhn.domain.server.Server as s
- where s.id in (:sids) and s.serverArch.archType.label = 'sysv-solaris']]>
- </query>
-
<sql-query name="Server.findVirtPlatformHostsByOrg">
<![CDATA[select s.id as id, s.name as name, count(vi.id) as count
diff --git a/java/code/src/com/redhat/rhn/frontend/events/SsmInstallPackagesAction.java b/java/code/src/com/redhat/rhn/frontend/events/SsmInstallPackagesAction.java
index 09441fc..77c4024 100644
--- a/java/code/src/com/redhat/rhn/frontend/events/SsmInstallPackagesAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/events/SsmInstallPackagesAction.java
@@ -14,27 +14,28 @@
*/
package com.redhat.rhn.frontend.events;
-import com.redhat.rhn.common.localization.LocalizationService;
-import com.redhat.rhn.common.messaging.EventMessage;
-import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.domain.user.UserFactory;
-import com.redhat.rhn.frontend.action.SetLabels;
-import com.redhat.rhn.frontend.dto.EssentialServerDto;
-import com.redhat.rhn.frontend.dto.PackageListItem;
-import com.redhat.rhn.manager.action.ActionManager;
-import com.redhat.rhn.manager.rhnset.RhnSetDecl;
-import com.redhat.rhn.manager.ssm.SsmOperationManager;
-import com.redhat.rhn.manager.system.SystemManager;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.Set;
+import java.util.List;
import java.util.ArrayList;
+import java.util.Map;
import java.util.Date;
import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import com.redhat.rhn.common.messaging.EventMessage;
+import com.redhat.rhn.common.localization.LocalizationService;
+import com.redhat.rhn.manager.ssm.SsmOperationManager;
+import com.redhat.rhn.manager.action.ActionManager;
+import com.redhat.rhn.manager.rhnset.RhnSetDecl;
+import com.redhat.rhn.manager.system.SystemManager;
+import com.redhat.rhn.domain.user.User;
+import com.redhat.rhn.domain.server.Server;
+import com.redhat.rhn.domain.server.ServerFactory;
+import com.redhat.rhn.frontend.dto.PackageListItem;
+import com.redhat.rhn.frontend.dto.EssentialServerDto;
+import com.redhat.rhn.frontend.action.SetLabels;
/**
* Schedules package installations on systems in the SSM.
@@ -91,13 +92,17 @@ public class SsmInstallPackagesAction extends AbstractDatabaseAction {
PackageListItem.toKeyMaps(packageListItems);
// Create one action for all servers to which the packages are installed
+ List<Server> actionServers = new ArrayList<Server>(servers.size());
List<Long> serverIds = new LinkedList<Long>();
for (EssentialServerDto dto : servers) {
serverIds.add(dto.getId());
}
-
+ log.debug("Looking up server objects.");
+ actionServers.addAll(ServerFactory.lookupByIdsAndUser(serverIds, user));
log.debug("Scheduling actions.");
- ActionManager.schedulePackageInstall(user, serverIds,
+
+
+ ActionManager.schedulePackageInstall(user, actionServers,
packageListData, earliest);
log.debug("Done scheduling package installations.");
diff --git a/java/code/src/com/redhat/rhn/frontend/events/SsmRemovePackagesAction.java b/java/code/src/com/redhat/rhn/frontend/events/SsmRemovePackagesAction.java
index ee3fafa..55ee1dc 100644
--- a/java/code/src/com/redhat/rhn/frontend/events/SsmRemovePackagesAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/events/SsmRemovePackagesAction.java
@@ -14,25 +14,26 @@
*/
package com.redhat.rhn.frontend.events;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.log4j.Logger;
import com.redhat.rhn.common.db.datasource.DataResult;
import com.redhat.rhn.common.localization.LocalizationService;
import com.redhat.rhn.common.messaging.EventMessage;
+import com.redhat.rhn.domain.server.Server;
+import com.redhat.rhn.domain.server.ServerFactory;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.domain.user.UserFactory;
import com.redhat.rhn.frontend.dto.PackageListItem;
import com.redhat.rhn.manager.action.ActionManager;
-import com.redhat.rhn.manager.rhnset.RhnSetDecl;
import com.redhat.rhn.manager.ssm.SsmOperationManager;
-
-import org.apache.log4j.Logger;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import com.redhat.rhn.manager.rhnset.RhnSetDecl;
/**
* Handles removing packages from servers in the SSM.
@@ -90,8 +91,8 @@ public class SsmRemovePackagesAction extends AbstractDatabaseAction {
// total of all packages selected
Set<PackageListItem> allPackages = new HashSet<PackageListItem>();
-
- Set<Long> allServerIds = new HashSet<Long>();
+ // Looking up all the server objects in Hibernate was *brutally* slow here:
+ List<Long> allServerIds = new LinkedList<Long>();
// Iterate the data, which is essentially each unique package/server combination
// to remove. Note that this is only for servers that we have marked as having the
@@ -117,17 +118,16 @@ public class SsmRemovePackagesAction extends AbstractDatabaseAction {
}
}
+ List<Server> allServers = new ArrayList<Server>(result.size());
+ allServers.addAll(ServerFactory.lookupByIdsAndUser(allServerIds, user));
log.debug("Converting data to maps.");
- List<PackageListItem> allPackagesList =
- new ArrayList<PackageListItem>(allPackages);
+ List<PackageListItem> allPackagesList = new ArrayList<PackageListItem>(allPackages);
List<Map<String, Long>> packageListData =
PackageListItem.toKeyMaps(allPackagesList);
log.debug("Scheduling package removals.");
- ActionManager.schedulePackageRemoval(user, allServerIds,
- packageListData, earliest);
-
+ ActionManager.schedulePackageRemoval(user, allServers, packageListData, earliest);
log.debug("Done.");
}
diff --git a/java/code/src/com/redhat/rhn/frontend/events/SsmUpgradePackagesAction.java b/java/code/src/com/redhat/rhn/frontend/events/SsmUpgradePackagesAction.java
index af22b5b..5647b81 100644
--- a/java/code/src/com/redhat/rhn/frontend/events/SsmUpgradePackagesAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/events/SsmUpgradePackagesAction.java
@@ -14,22 +14,22 @@
*/
package com.redhat.rhn.frontend.events;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import org.apache.log4j.Logger;
import com.redhat.rhn.common.db.datasource.DataResult;
import com.redhat.rhn.common.localization.LocalizationService;
import com.redhat.rhn.common.messaging.EventMessage;
+import com.redhat.rhn.domain.server.Server;
+import com.redhat.rhn.domain.server.ServerFactory;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.domain.user.UserFactory;
import com.redhat.rhn.manager.action.ActionManager;
-import com.redhat.rhn.manager.rhnset.RhnSetDecl;
import com.redhat.rhn.manager.ssm.SsmOperationManager;
-
-import org.apache.log4j.Logger;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import com.redhat.rhn.manager.rhnset.RhnSetDecl;
/**
* Handles removing packages from servers in the SSM.
@@ -103,7 +103,8 @@ public class SsmUpgradePackagesAction extends AbstractDatabaseAction {
serverIds.add(serverId);
}
- ActionManager.schedulePackageUpgrades(user, serverIds, packageListItems, earliest);
+ List<Server> serverList = ServerFactory.lookupByIdsAndUser(serverIds, user);
+ ActionManager.schedulePackageUpgrades(user, serverList, packageListItems, earliest);
if (log.isDebugEnabled()) {
log.debug("Time to schedule all actions: " +
diff --git a/java/code/src/com/redhat/rhn/manager/action/ActionManager.java b/java/code/src/com/redhat/rhn/manager/action/ActionManager.java
index ee8268f..b98c1a2 100644
--- a/java/code/src/com/redhat/rhn/manager/action/ActionManager.java
+++ b/java/code/src/com/redhat/rhn/manager/action/ActionManager.java
@@ -54,7 +54,6 @@ import com.redhat.rhn.domain.rhnpackage.PatchSet;
import com.redhat.rhn.domain.rhnset.RhnSet;
import com.redhat.rhn.domain.rhnset.RhnSetElement;
import com.redhat.rhn.domain.server.Server;
-import com.redhat.rhn.domain.server.ServerFactory;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.frontend.dto.PackageMetadata;
import com.redhat.rhn.frontend.listview.PageControl;
@@ -1104,32 +1103,41 @@ public class ActionManager extends BaseManager {
* Schedules one or more package removal actions on one or more servers.
*
* @param scheduler user scheduling the action.
- * @param serverIds servers from which to remove the packages
+ * @param servers servers from which to remove the packages
* @param pkgs list of packages to be removed.
* @param earliestAction date of earliest action to be executed
*/
public static void schedulePackageRemoval(User scheduler,
- Collection<Long> serverIds, List<Map<String, Long>> pkgs, Date earliestAction) {
+ List<Server> servers, List<Map<String, Long>> pkgs, Date earliestAction) {
// Different handling for package removal on solaris v. rhel, so split out
// the servers first in case the list is mixed.
- Set<Long> rhelServers = new HashSet<Long>();
- rhelServers.addAll(ServerFactory.listLinuxSystems(serverIds));
- Set<Long> solarisServers = new HashSet<Long>();
- solarisServers.addAll(ServerFactory.listSolarisSystems(serverIds));
+ List<Server> rhelServers = new ArrayList<Server>();
+ List<Server> solarisServers = new ArrayList<Server>();
+
+ for (Server server : servers) {
+ if (server.isSolaris()) {
+ solarisServers.add(server);
+ }
+ else {
+ rhelServers.add(server);
+ }
+ }
// Since the solaris v. rhel distinction results in a different action type,
// we'll end up with 2 actions created if the server list is mixed
if (!rhelServers.isEmpty()) {
+ Server[] s = rhelServers.toArray(new Server[rhelServers.size()]);
schedulePackageAction(scheduler, pkgs, ActionFactory.TYPE_PACKAGES_REMOVE,
- earliestAction, rhelServers);
+ earliestAction, s);
}
if (!solarisServers.isEmpty()) {
+ Server[] s = solarisServers.toArray(new Server[solarisServers.size()]);
schedulePackageAction(scheduler, pkgs, ActionFactory.TYPE_SOLARISPKGS_REMOVE,
- earliestAction, solarisServers);
+ earliestAction, s);
}
- }
+ }
/**
* Schedules one or more package upgrade actions for the given server.
@@ -1149,13 +1157,13 @@ public class ActionManager extends BaseManager {
* Schedules one or more package upgrade actions for the given servers.
* Note: package upgrade = package install
* @param scheduler User scheduling the action.
- * @param sids list of server ids on which the action affects.
+ * @param srvr list of servers on which the action affects.
* @param pkgs The set of packages to be removed.
* @param earliestAction Date of earliest action to be executed
*/
public static void schedulePackageUpgrades(User scheduler,
- List<Long> sids, List<Map<String, Long>> pkgs, Date earliestAction) {
- schedulePackageInstall(scheduler, sids, pkgs, earliestAction);
+ List<Server> srvr, List<Map<String, Long>> pkgs, Date earliestAction) {
+ schedulePackageInstall(scheduler, srvr, pkgs, earliestAction);
}
/**
@@ -1195,30 +1203,39 @@ public class ActionManager extends BaseManager {
/**
* Schedules one or more package installation actions on one or more servers.
* @param scheduler user scheduling the action.
- * @param serverIds server ids for which the packages should be installed
+ * @param servers servers for which the packages should be installed
* @param pkgs set of packages to be removed.
* @param earliestAction date of earliest action to be executed
*/
public static void schedulePackageInstall(User scheduler,
- Collection<Long> serverIds, List pkgs, Date earliestAction) {
+ List<Server> servers, List pkgs, Date earliestAction) {
// Different handling for package installs on solaris v. rhel, so split out
// the servers first in case the list is mixed.
- Set<Long> rhelServers = new HashSet<Long>();
- rhelServers.addAll(ServerFactory.listLinuxSystems(serverIds));
- Set<Long> solarisServers = new HashSet<Long>();
- solarisServers.addAll(ServerFactory.listSolarisSystems(serverIds));
+ List<Server> rhelServers = new ArrayList<Server>();
+ List<Server> solarisServers = new ArrayList<Server>();
+
+ for (Server server : servers) {
+ if (server.isSolaris()) {
+ solarisServers.add(server);
+ }
+ else {
+ rhelServers.add(server);
+ }
+ }
// Since the solaris v. rhel distinction results in a different action type,
// we'll end up with 2 actions created if the server list is mixed
if (!rhelServers.isEmpty()) {
+ Server[] s = rhelServers.toArray(new Server[rhelServers.size()]);
schedulePackageAction(scheduler, pkgs, ActionFactory.TYPE_PACKAGES_UPDATE,
- earliestAction, rhelServers);
+ earliestAction, s);
}
if (!solarisServers.isEmpty()) {
+ Server[] s = solarisServers.toArray(new Server[solarisServers.size()]);
schedulePackageAction(scheduler, pkgs, ActionFactory.TYPE_SOLARISPKGS_INSTALL,
- earliestAction, solarisServers);
+ earliestAction, s);
}
}
@@ -1268,7 +1285,8 @@ public class ActionManager extends BaseManager {
public static PackageAction schedulePackageVerify(User scheduler,
Server srvr, List<Map<String, Long>> pkgs, Date earliest) {
return (PackageAction) schedulePackageAction(scheduler, pkgs,
- ActionFactory.TYPE_PACKAGES_VERIFY, earliest, srvr);
+ ActionFactory.TYPE_PACKAGES_VERIFY, earliest, srvr
+ );
}
/**
* Schedules one or more package installation actions for the given server.
@@ -1316,28 +1334,19 @@ public class ActionManager extends BaseManager {
}
private static Action scheduleAction(User scheduler, ActionType type, String name,
- Date earliestAction, Set<Long> serverIds) {
+ Date earliestAction, Server... servers) {
Action action = createScheduledAction(scheduler, type, name, earliestAction);
- ActionFactory.save(action);
- action = (Action) ActionFactory.reload(action);
-
-
- Map params = new HashMap();
- params.put("status_id", ActionFactory.STATUS_QUEUED.getId());
- params.put("tries", REMAINING_TRIES);
- params.put("parent_id", action.getId());
- //params.put("sid", sid);
-
- WriteMode m = ModeFactory.getWriteMode("Action_queries",
- "insert_server_actions");
- List<Long> sidList = new ArrayList<Long>();
- sidList.addAll(serverIds);
- m.executeUpdate(params, sidList);
-
+ for (Server server : servers) {
+ ServerAction sa = new ServerAction();
+ sa.setStatus(ActionFactory.STATUS_QUEUED);
+ sa.setRemainingTries(REMAINING_TRIES);
+ sa.setServer(server);
- //action.addServerAction(sa);
+ action.addServerAction(sa);
+ sa.setParentAction(action);
+ }
return action;
}
@@ -1603,34 +1612,10 @@ public class ActionManager extends BaseManager {
* @return The action that has been scheduled.
*/
public static Action schedulePackageAction(User scheduler,
- List pkgs,
- ActionType type,
- Date earliestAction,
- Server...servers) {
- Set<Long> serverIds = new HashSet<Long>();
- for (Server s : servers) {
- serverIds.add(s.getId());
- }
- return schedulePackageAction(scheduler, pkgs, type, earliestAction, serverIds);
- }
-
- /**
- * Schedules a package action of the given type for the given server with the
- * packages given as a list.
- * @param scheduler The user scheduling the action.
- * @param pkgs A list of maps containing keys 'name_id', 'evr_id' and
- * optional 'arch_id' with Long values.
- * @param type The type of the package action. One of the static types found in
- * ActionFactory
- * @param earliestAction The earliest time that this action could happen.
- * @param serverIds The server ids that this action is for.
- * @return The action that has been scheduled.
- */
- public static Action schedulePackageAction(User scheduler,
List pkgs,
ActionType type,
Date earliestAction,
- Set<Long> serverIds) {
+ Server... servers) {
String name = "";
if (type.equals(ActionFactory.TYPE_PACKAGES_REMOVE) ||
@@ -1648,7 +1633,7 @@ public class ActionManager extends BaseManager {
name = "Package Synchronization";
}
- Action action = scheduleAction(scheduler, type, name, earliestAction, serverIds);
+ Action action = scheduleAction(scheduler, type, name, earliestAction, servers);
ActionFactory.save(action);
if (pkgs != null) {
diff --git a/schema/spacewalk/upgrade/rhn-satellite-schema-5.1-to-spacewalk-schema-0.2 b/schema/spacewalk/upgrade/rhn-satellite-schema-5.1-to-spacewalk-schema-0.2
new file mode 120000
index 0000000..f612f22
--- /dev/null
+++ b/schema/spacewalk/upgrade/rhn-satellite-schema-5.1-to-spacewalk-schema-0.2
@@ -0,0 +1 @@
+satellite-5.1-spacewalk-0.2
\ No newline at end of file
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-0.2-to-spacewalk-schema-0.3 b/schema/spacewalk/upgrade/spacewalk-schema-0.2-to-spacewalk-schema-0.3
new file mode 120000
index 0000000..b48bb8a
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-0.2-to-spacewalk-schema-0.3
@@ -0,0 +1 @@
+spacewalk-0.2-spacewalk-0.3
\ No newline at end of file
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-0.3-to-spacewalk-schema-0.4 b/schema/spacewalk/upgrade/spacewalk-schema-0.3-to-spacewalk-schema-0.4
new file mode 120000
index 0000000..64b32f3
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-0.3-to-spacewalk-schema-0.4
@@ -0,0 +1 @@
+spacewalk-0.3-spacewalk-0.4
\ No newline at end of file
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-0.4-to-spacewalk-schema-0.5 b/schema/spacewalk/upgrade/spacewalk-schema-0.4-to-spacewalk-schema-0.5
new file mode 120000
index 0000000..a9f7adb
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-0.4-to-spacewalk-schema-0.5
@@ -0,0 +1 @@
+spacewalk-0.4-spacewalk-0.5
\ No newline at end of file
commit d7856b103c43690d2d1ee197dc40f2d54f07f682
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed Sep 30 11:31:21 2009 -0400
Revert "adding workaround for hibernate oddity/bug"
This reverts commit 7e51e6b06314e5a01e1c028f6d1221017ff27297.
diff --git a/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java b/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
index 06787c9..7ce8f0b 100644
--- a/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
@@ -40,7 +40,6 @@ import org.hibernate.Session;
import java.sql.Types;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
@@ -771,10 +770,6 @@ public class ServerFactory extends HibernateFactory {
* @return list of system ids that are solaris systems
*/
public static List<Long> listSolarisSystems(Collection<Long> systemIds) {
- //Hibernate can't handle empty lists for in clauses, silly hibernate
- if (systemIds.isEmpty()) {
- return Collections.EMPTY_LIST;
- }
return ServerFactory.getSession().getNamedQuery("Server.listSolarisSystems").
setParameterList("sids", systemIds).list();
}
@@ -786,10 +781,6 @@ public class ServerFactory extends HibernateFactory {
* @return list of system ids that are linux systems
*/
public static List<Long> listLinuxSystems(Collection<Long> systemIds) {
- //Hibernate can't handle empty lists for in clauses, silly hibernate
- if (systemIds.isEmpty()) {
- return Collections.EMPTY_LIST;
- }
return ServerFactory.getSession().getNamedQuery("Server.listRedHatSystems").
setParameterList("sids", systemIds).list();
commit f60520ffe2dc81022763087ec691752447bf1b05
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed Sep 30 11:30:47 2009 -0400
Reverting commit not indended for VADER
This reverts commit 090c5f3ad8a4c6270b0047ed86dff35758b56263.
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/SystemGroup_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/SystemGroup_queries.xml
index f85288f..39d7ecf 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/SystemGroup_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/SystemGroup_queries.xml
@@ -23,27 +23,27 @@
( SELECT 1 from dual where exists
- (select /*+ ORDERED */ 1 FROM rhnServerGroupMembers SGM,
- rhnServerNeededErrataCache SNPC,
- rhnErrata E
+ (select 1 FROM rhnErrata E,
+ rhnServerNeededPackageCache SNPC,
+ rhnServerGroupMembers SGM
WHERE E.advisory_type = 'Security Advisory'
and snpc.errata_id = e.id
and snpc.server_id = sgm.server_id
and sgm.server_group_id = G.id)) AS SECURITY_ERRATA,
(SELECT 1 from dual where exists
- (select /*+ ORDERED */ 1 FROM rhnServerGroupMembers SGM,
- rhnServerNeededErrataCache SNPC,
- rhnErrata E
+ (select 1 FROM rhnErrata E,
+ rhnServerNeededPackageCache SNPC,
+ rhnServerGroupMembers SGM
WHERE E.advisory_type = 'Bug Fix Advisory'
and snpc.errata_id = e.id
and snpc.server_id = sgm.server_id
and sgm.server_group_id = G.id)) AS BUG_ERRATA,
(SELECT 1 from dual where exists
- (select /*+ ORDERED */ 1 FROM rhnServerGroupMembers SGM,
- rhnServerNeededErrataCache SNPC,
- rhnErrata E
+ (select 1 FROM rhnErrata E,
+ rhnServerNeededPackageCache SNPC,
+ rhnServerGroupMembers SGM
WHERE E.advisory_type = 'Product Enhancement Advisory'
and snpc.errata_id = e.id
and snpc.server_id = sgm.server_id
commit 53a06a83263a7aeb8b1b1adabafaae918cdb845c
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed Sep 30 11:30:14 2009 -0400
Revert commit not intended for VADER
This reverts commit 7c9d5dd3a5c3d975f406215b4af7c5bcbddbf9d8.
diff --git a/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java b/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
index ebc36a8..06787c9 100644
--- a/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
@@ -771,31 +771,12 @@ public class ServerFactory extends HibernateFactory {
* @return list of system ids that are solaris systems
*/
public static List<Long> listSolarisSystems(Collection<Long> systemIds) {
- return listGenericSystems(systemIds, "Server.listSolarisSystems");
- }
-
-
-
- private static List<Long> listGenericSystems(Collection<Long> systemIds, String query) {
//Hibernate can't handle empty lists for in clauses, silly hibernate
if (systemIds.isEmpty()) {
return Collections.EMPTY_LIST;
}
- ArrayList<Long> tmpList = new ArrayList<Long>();
- List<Long> toRet = new ArrayList<Long>();
- tmpList.addAll(systemIds);
-
- for (int i = 0; i < systemIds.size();) {
- int initial = i;
- int fin = i + 500 < systemIds.size() ? i + 500 : systemIds.size();
- List<Long> sublist = tmpList.subList(i, fin);
- toRet.addAll(ServerFactory.getSession().getNamedQuery(query).
- setParameterList("sids", sublist).list());
- i = fin+1;
- }
-
- return toRet;
-
+ return ServerFactory.getSession().getNamedQuery("Server.listSolarisSystems").
+ setParameterList("sids", systemIds).list();
}
/**
@@ -805,7 +786,13 @@ public class ServerFactory extends HibernateFactory {
* @return list of system ids that are linux systems
*/
public static List<Long> listLinuxSystems(Collection<Long> systemIds) {
- return listGenericSystems(systemIds, "Server.listRedHatSystems");
+ //Hibernate can't handle empty lists for in clauses, silly hibernate
+ if (systemIds.isEmpty()) {
+ return Collections.EMPTY_LIST;
+ }
+ return ServerFactory.getSession().getNamedQuery("Server.listRedHatSystems").
+ setParameterList("sids", systemIds).list();
+
}
}
13 years, 8 months
java/code
by Justin Sherrill
java/code/src/com/redhat/rhn/domain/server/ServerFactory.java | 31 +++++++---
1 file changed, 22 insertions(+), 9 deletions(-)
New commits:
commit 5073c7dd19a65d1b0cc15854d6e88e1f65eef003
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Tue Sep 29 17:14:53 2009 -0400
workaround for hibernate not handling in caluses of more than 1000
diff --git a/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java b/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
index a6092dc..6b27799 100644
--- a/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
@@ -748,12 +748,31 @@ public class ServerFactory extends HibernateFactory {
* @return list of system ids that are solaris systems
*/
public static List<Long> listSolarisSystems(Collection<Long> systemIds) {
+ return listGenericSystems(systemIds, "Server.listSolarisSystems");
+ }
+
+
+
+ private static List<Long> listGenericSystems(Collection<Long> systemIds, String query) {
//Hibernate can't handle empty lists for in clauses, silly hibernate
if (systemIds.isEmpty()) {
return Collections.EMPTY_LIST;
}
- return ServerFactory.getSession().getNamedQuery("Server.listSolarisSystems").
- setParameterList("sids", systemIds).list();
+ ArrayList<Long> tmpList = new ArrayList<Long>();
+ List<Long> toRet = new ArrayList<Long>();
+ tmpList.addAll(systemIds);
+
+ for (int i = 0; i < systemIds.size();) {
+ int initial = i;
+ int fin = i + 500 < systemIds.size() ? i + 500 : systemIds.size();
+ List<Long> sublist = tmpList.subList(i, fin);
+ toRet.addAll(ServerFactory.getSession().getNamedQuery(query).
+ setParameterList("sids", sublist).list());
+ i = fin+1;
+ }
+
+ return toRet;
+
}
/**
@@ -763,13 +782,7 @@ public class ServerFactory extends HibernateFactory {
* @return list of system ids that are linux systems
*/
public static List<Long> listLinuxSystems(Collection<Long> systemIds) {
- //Hibernate can't handle empty lists for in clauses, silly hibernate
- if (systemIds.isEmpty()) {
- return Collections.EMPTY_LIST;
- }
- return ServerFactory.getSession().getNamedQuery("Server.listRedHatSystems").
- setParameterList("sids", systemIds).list();
-
+ return listGenericSystems(systemIds, "Server.listRedHatSystems");
}
}
13 years, 8 months
Branch 'VADER' - 3 commits - java/code
by Justin Sherrill
java/code/src/com/redhat/rhn/common/db/datasource/xml/SystemGroup_queries.xml | 18 ++---
java/code/src/com/redhat/rhn/domain/server/ServerFactory.java | 32 ++++++++--
2 files changed, 36 insertions(+), 14 deletions(-)
New commits:
commit 7c9d5dd3a5c3d975f406215b4af7c5bcbddbf9d8
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Tue Sep 29 17:14:53 2009 -0400
workaround for hibernate not handling in caluses of more than 1000
diff --git a/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java b/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
index 06787c9..ebc36a8 100644
--- a/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
@@ -771,12 +771,31 @@ public class ServerFactory extends HibernateFactory {
* @return list of system ids that are solaris systems
*/
public static List<Long> listSolarisSystems(Collection<Long> systemIds) {
+ return listGenericSystems(systemIds, "Server.listSolarisSystems");
+ }
+
+
+
+ private static List<Long> listGenericSystems(Collection<Long> systemIds, String query) {
//Hibernate can't handle empty lists for in clauses, silly hibernate
if (systemIds.isEmpty()) {
return Collections.EMPTY_LIST;
}
- return ServerFactory.getSession().getNamedQuery("Server.listSolarisSystems").
- setParameterList("sids", systemIds).list();
+ ArrayList<Long> tmpList = new ArrayList<Long>();
+ List<Long> toRet = new ArrayList<Long>();
+ tmpList.addAll(systemIds);
+
+ for (int i = 0; i < systemIds.size();) {
+ int initial = i;
+ int fin = i + 500 < systemIds.size() ? i + 500 : systemIds.size();
+ List<Long> sublist = tmpList.subList(i, fin);
+ toRet.addAll(ServerFactory.getSession().getNamedQuery(query).
+ setParameterList("sids", sublist).list());
+ i = fin+1;
+ }
+
+ return toRet;
+
}
/**
@@ -786,13 +805,7 @@ public class ServerFactory extends HibernateFactory {
* @return list of system ids that are linux systems
*/
public static List<Long> listLinuxSystems(Collection<Long> systemIds) {
- //Hibernate can't handle empty lists for in clauses, silly hibernate
- if (systemIds.isEmpty()) {
- return Collections.EMPTY_LIST;
- }
- return ServerFactory.getSession().getNamedQuery("Server.listRedHatSystems").
- setParameterList("sids", systemIds).list();
-
+ return listGenericSystems(systemIds, "Server.listRedHatSystems");
}
}
commit 090c5f3ad8a4c6270b0047ed86dff35758b56263
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Tue Sep 29 16:35:00 2009 -0400
query fix for groups page
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/SystemGroup_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/SystemGroup_queries.xml
index 39d7ecf..f85288f 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/SystemGroup_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/SystemGroup_queries.xml
@@ -23,27 +23,27 @@
( SELECT 1 from dual where exists
- (select 1 FROM rhnErrata E,
- rhnServerNeededPackageCache SNPC,
- rhnServerGroupMembers SGM
+ (select /*+ ORDERED */ 1 FROM rhnServerGroupMembers SGM,
+ rhnServerNeededErrataCache SNPC,
+ rhnErrata E
WHERE E.advisory_type = 'Security Advisory'
and snpc.errata_id = e.id
and snpc.server_id = sgm.server_id
and sgm.server_group_id = G.id)) AS SECURITY_ERRATA,
(SELECT 1 from dual where exists
- (select 1 FROM rhnErrata E,
- rhnServerNeededPackageCache SNPC,
- rhnServerGroupMembers SGM
+ (select /*+ ORDERED */ 1 FROM rhnServerGroupMembers SGM,
+ rhnServerNeededErrataCache SNPC,
+ rhnErrata E
WHERE E.advisory_type = 'Bug Fix Advisory'
and snpc.errata_id = e.id
and snpc.server_id = sgm.server_id
and sgm.server_group_id = G.id)) AS BUG_ERRATA,
(SELECT 1 from dual where exists
- (select 1 FROM rhnErrata E,
- rhnServerNeededPackageCache SNPC,
- rhnServerGroupMembers SGM
+ (select /*+ ORDERED */ 1 FROM rhnServerGroupMembers SGM,
+ rhnServerNeededErrataCache SNPC,
+ rhnErrata E
WHERE E.advisory_type = 'Product Enhancement Advisory'
and snpc.errata_id = e.id
and snpc.server_id = sgm.server_id
commit 7e51e6b06314e5a01e1c028f6d1221017ff27297
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Tue Sep 29 11:53:47 2009 -0400
adding workaround for hibernate oddity/bug
diff --git a/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java b/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
index 7ce8f0b..06787c9 100644
--- a/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
@@ -40,6 +40,7 @@ import org.hibernate.Session;
import java.sql.Types;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
@@ -770,6 +771,10 @@ public class ServerFactory extends HibernateFactory {
* @return list of system ids that are solaris systems
*/
public static List<Long> listSolarisSystems(Collection<Long> systemIds) {
+ //Hibernate can't handle empty lists for in clauses, silly hibernate
+ if (systemIds.isEmpty()) {
+ return Collections.EMPTY_LIST;
+ }
return ServerFactory.getSession().getNamedQuery("Server.listSolarisSystems").
setParameterList("sids", systemIds).list();
}
@@ -781,6 +786,10 @@ public class ServerFactory extends HibernateFactory {
* @return list of system ids that are linux systems
*/
public static List<Long> listLinuxSystems(Collection<Long> systemIds) {
+ //Hibernate can't handle empty lists for in clauses, silly hibernate
+ if (systemIds.isEmpty()) {
+ return Collections.EMPTY_LIST;
+ }
return ServerFactory.getSession().getNamedQuery("Server.listRedHatSystems").
setParameterList("sids", systemIds).list();
13 years, 8 months
java/code
by Miroslav Suchý
java/code/src/com/redhat/rhn/domain/channel/Channel.java | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
New commits:
commit 4f4be35b9258cd089fce4fc14389222f596bc2a0
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Sep 30 15:57:05 2009 +0200
523673 - generate repomd for zstreams too
diff --git a/java/code/src/com/redhat/rhn/domain/channel/Channel.java b/java/code/src/com/redhat/rhn/domain/channel/Channel.java
index 21dcb70..d4f0285 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/Channel.java
+++ b/java/code/src/com/redhat/rhn/domain/channel/Channel.java
@@ -790,9 +790,18 @@ public class Channel extends BaseDomainHelper implements Comparable {
toConsider = toConsider.getParentChannel();
}
+ String release = null;
DistChannelMap channelDist = ChannelFactory.lookupDistChannelMap(toConsider);
if (channelDist != null) {
- String release = channelDist.getRelease();
+ release = channelDist.getRelease();
+ }
+ else { // and now again for zstreams
+ ReleaseChannelMap channelRelease = ChannelFactory.lookupDefaultReleaseChannelMapForChannel(toConsider);
+ if (channelRelease != null) {
+ release = channelRelease.getRelease();
+ }
+ }
+ if (release != null) {
if (!releaseToSkipRepodata.contains(release)) {
repodataRequired = true;
log.debug("isChannelRepodataRequired for channel(" + this.id + ") " +
13 years, 8 months
backend/server
by Milan Zazrivec
backend/server/importlib/headerSource.py | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit fcbfd62472dd16a078a3b1375ad9eec8d02c94f4
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Wed Sep 30 15:31:08 2009 +0200
524231 - correctly expand file list for RPM v3 packages
diff --git a/backend/server/importlib/headerSource.py b/backend/server/importlib/headerSource.py
index e41e854..35753a2 100644
--- a/backend/server/importlib/headerSource.py
+++ b/backend/server/importlib/headerSource.py
@@ -369,6 +369,9 @@ def createPackage(header, size, md5sum, relpath, org_id, header_start,
log_debug(4, "Creating package")
p = rpmBinaryPackage()
+ # bug #524231 - we need to call fullFilelist() for RPM v3 file list
+ # to expand correctly
+ header.hdr.fullFilelist()
p.populate(header, size, md5sum, relpath, org_id, header_start, header_end,
channels)
return p
13 years, 8 months
backend/satellite_tools
by Jan Pazdziora
backend/satellite_tools/updatePackages.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 6f85a0c6ffc04b294f574707ffdfa555a00dd23d
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Sep 30 13:23:30 2009 +0200
Catch all exceptions, so that we commit in all cases.
diff --git a/backend/satellite_tools/updatePackages.py b/backend/satellite_tools/updatePackages.py
index 3e79aaa..35a07ba 100644
--- a/backend/satellite_tools/updatePackages.py
+++ b/backend/satellite_tools/updatePackages.py
@@ -190,7 +190,7 @@ def process_package_data():
try:
hdr = rhn_rpm.get_package_header(filename=old_abs_path)
- except IOError:
+ except:
rhnSQL.commit()
raise
13 years, 8 months
backend/satellite_tools
by Jan Pazdziora
backend/satellite_tools/updatePackages.py | 1 +
1 file changed, 1 insertion(+)
New commits:
commit 2c2ecdc9bb933185f8cec116999345bba6353c99
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Sep 30 13:19:50 2009 +0200
If we fail, let us commit the previous updates (done in this transaction).
diff --git a/backend/satellite_tools/updatePackages.py b/backend/satellite_tools/updatePackages.py
index d7553fa..3e79aaa 100644
--- a/backend/satellite_tools/updatePackages.py
+++ b/backend/satellite_tools/updatePackages.py
@@ -191,6 +191,7 @@ def process_package_data():
try:
hdr = rhn_rpm.get_package_header(filename=old_abs_path)
except IOError:
+ rhnSQL.commit()
raise
if old_abs_path != new_abs_path:
13 years, 8 months
backend/satellite_tools
by Jan Pazdziora
backend/satellite_tools/updatePackages.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 5f51c5f9cac3c2402c01366f1803a494bea2db38
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Sep 30 13:14:00 2009 +0200
Do the rhn_rpm.get_package_header before we do the actual move.
As this call can fail and abort the whole script, we move this
up, before we start to do the actual rename.
Note that we have to call it with old_abs_path.
diff --git a/backend/satellite_tools/updatePackages.py b/backend/satellite_tools/updatePackages.py
index 0a6cdf2..d7553fa 100644
--- a/backend/satellite_tools/updatePackages.py
+++ b/backend/satellite_tools/updatePackages.py
@@ -188,6 +188,11 @@ def process_package_data():
if debug: Log.writeMessage("Missing path %s for package %d" % ( old_abs_path, path['id']))
continue
+ try:
+ hdr = rhn_rpm.get_package_header(filename=old_abs_path)
+ except IOError:
+ raise
+
if old_abs_path != new_abs_path:
new_abs_dir = os.path.dirname(new_abs_path)
# relocate the package on the filer
@@ -207,11 +212,6 @@ def process_package_data():
if debug: Log.writeMessage("query Executed: update rhnPackage %d to %s" \
% ( path['id'], new_path ))
# Process gpg key ids
- try:
- #hdr = get_package_info(old_abs_path)
- hdr = rhn_rpm.get_package_header(filename=new_abs_path)
- except IOError:
- raise
server_packages.processPackageKeyAssociations(hdr, md5sum)
if debug: Log.writeMessage("gpg key info updated from %s" % new_abs_path )
i = i + 1
13 years, 8 months
Changes to 'refs/tags/yum-rhn-plugin-0.7.5-1'
by Miroslav Suchý
Tag 'yum-rhn-plugin-0.7.5-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2009-09-30 07:25 +0000
Tagging package [yum-rhn-plugin] version [0.7.5-1] in directory [client/rhel/yum-rhn-plugin/].
Changes since yum-rhn-plugin-0.7.4-1:
Jan Pazdziora (1):
No commit in processPackageKeyAssociations.
Justin Sherrill (1):
adding workaround for hibernate oddity/bug
Miroslav Suchý (2):
525453 - add LICENSE file
Automatic commit of package [yum-rhn-plugin] release [0.7.5-1].
---
backend/server/rhnServer/server_packages.py | 3
client/rhel/yum-rhn-plugin/LICENSE | 339 ++++++++++
client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec | 7
java/code/src/com/redhat/rhn/domain/server/ServerFactory.java | 9
rel-eng/packages/yum-rhn-plugin | 2
5 files changed, 354 insertions(+), 6 deletions(-)
---
13 years, 8 months
2 commits - client/rhel rel-eng/packages
by Miroslav Suchý
client/rhel/yum-rhn-plugin/LICENSE | 339 +++++++++++++++++++++++++
client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec | 7
rel-eng/packages/yum-rhn-plugin | 2
3 files changed, 345 insertions(+), 3 deletions(-)
New commits:
commit ba9b09415988100a2414509bba6ab52d050dca91
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Sep 30 09:25:49 2009 +0200
Automatic commit of package [yum-rhn-plugin] release [0.7.5-1].
diff --git a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
index 6b250a2..95b6619 100644
--- a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
+++ b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
@@ -1,6 +1,6 @@
Summary: RHN support for yum
Name: yum-rhn-plugin
-Version: 0.7.4
+Version: 0.7.5
Release: 1%{?dist}
License: GPLv2
Group: System Environment/Base
@@ -50,7 +50,7 @@ rm -rf $RPM_BUILD_ROOT
%doc LICENSE
%changelog
-* Wed Sep 30 2009 Miroslav Suchý <msuchy(a)redhat.com>
+* Wed Sep 30 2009 Miroslav Suchý <msuchy(a)redhat.com> 0.7.5-1
- add LICENSE
* Tue Sep 29 2009 Miroslav Suchý <msuchy(a)redhat.com> 0.7.4-1
diff --git a/rel-eng/packages/yum-rhn-plugin b/rel-eng/packages/yum-rhn-plugin
index c8358ef..bf19612 100644
--- a/rel-eng/packages/yum-rhn-plugin
+++ b/rel-eng/packages/yum-rhn-plugin
@@ -1 +1 @@
-0.7.4-1 client/rhel/yum-rhn-plugin/
+0.7.5-1 client/rhel/yum-rhn-plugin/
commit 3ff15169d747fd87aa87bdfb41f23464312af475
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Sep 30 09:24:52 2009 +0200
525453 - add LICENSE file
diff --git a/client/rhel/yum-rhn-plugin/LICENSE b/client/rhel/yum-rhn-plugin/LICENSE
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/client/rhel/yum-rhn-plugin/LICENSE
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
index 8e859b9..6b250a2 100644
--- a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
+++ b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
@@ -47,9 +47,12 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man*/*
%{_datadir}/yum-plugins/*
%{_datadir}/rhn/actions/*
-
+%doc LICENSE
%changelog
+* Wed Sep 30 2009 Miroslav Suchý <msuchy(a)redhat.com>
+- add LICENSE
+
* Tue Sep 29 2009 Miroslav Suchý <msuchy(a)redhat.com> 0.7.4-1
- add source url
- add fix version in provides
13 years, 8 months