Changes to 'refs/tags/osad-5.9.24-1'
by Michael Mraka
Tag 'osad-5.9.24-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2010-01-18 10:21 +0000
Tagging package [osad] version [5.9.24-1] in directory [client/tools/osad/].
Changes since spacewalk-backend-0.8.30-1:
Justin Sherrill (4):
518127 - adding a configchannel.deployAllSystems api call
unit test fixes
adding unit test for ConfigChannelHandler.deployAllSystems
506279 - speeding up channel.software.addPackages call by about 75 percent
Michael Mraka (2):
fixed syntax error
Automatic commit of package [osad] release [5.9.24-1].
---
client/tools/osad/osad.spec | 5
client/tools/osad/prog.init | 1
java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml | 7
java/code/src/com/redhat/rhn/domain/token/test/ActivationKeyTest.java | 3
java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java | 4
java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java | 70 +++++++
java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/test/ConfigChannelHandlerTest.java | 99 ++++++++++
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java | 9
java/code/src/com/redhat/rhn/manager/channel/ChannelEditor.java | 19 +
java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java | 7
java/code/src/com/redhat/rhn/manager/system/UpdateChildChannelsCommand.java | 24 +-
rel-eng/packages/osad | 2
12 files changed, 222 insertions(+), 28 deletions(-)
---
14 years, 4 months
2 commits - client/tools rel-eng/packages
by Michael Mraka
client/tools/osad/osad.spec | 5 ++++-
client/tools/osad/prog.init | 1 +
rel-eng/packages/osad | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit a1048dd07e4839467f2b6a924b9ad29de987134c
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Jan 18 11:21:38 2010 +0100
Automatic commit of package [osad] release [5.9.24-1].
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec
index ad52f41..0f2305a 100644
--- a/client/tools/osad/osad.spec
+++ b/client/tools/osad/osad.spec
@@ -9,7 +9,7 @@ Group: System Environment/Daemons
License: GPLv2
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.9.23
+Version: 5.9.24
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -234,6 +234,9 @@ rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvvi {}
# $Id$
%changelog
+* Mon Jan 18 2010 Michael Mraka <michael.mraka(a)redhat.com> 5.9.24-1
+- fixed syntax error in init.d scripts
+
* Fri Jan 15 2010 Michael Mraka <michael.mraka(a)redhat.com> 5.9.23-1
- implement condrestart for osad init script
- make reload alias for restart
diff --git a/rel-eng/packages/osad b/rel-eng/packages/osad
index 70be840..9fea795 100644
--- a/rel-eng/packages/osad
+++ b/rel-eng/packages/osad
@@ -1 +1 @@
-5.9.23-1 client/tools/osad/
+5.9.24-1 client/tools/osad/
commit f24eea97927bac3b0f52bde34ae06e956b013e0a
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Jan 18 11:19:16 2010 +0100
fixed syntax error
diff --git a/client/tools/osad/prog.init b/client/tools/osad/prog.init
index 86cd93a..9319791 100755
--- a/client/tools/osad/prog.init
+++ b/client/tools/osad/prog.init
@@ -73,6 +73,7 @@ case "$1" in
stop
start
fi
+ ;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}"
exit 1
14 years, 4 months
java/code
by Justin Sherrill
java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml | 7 +++
java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java | 4 +-
java/code/src/com/redhat/rhn/manager/channel/ChannelEditor.java | 19 +++++-----
java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java | 7 ++-
4 files changed, 23 insertions(+), 14 deletions(-)
New commits:
commit a096cbcb43f7cdce2853eb607b54824bbd98b10e
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Fri Jan 15 15:09:58 2010 -0500
506279 - speeding up channel.software.addPackages call by about 75 percent
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
index 51ed570..e3e2330 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
@@ -17,6 +17,13 @@ DELETE
</query>
</write-mode>
+<write-mode name="add_channel_packages">
+ <query params="cid">
+ INSERT INTO rhnChannelPackage (channel_id, package_id)
+ select :cid, P.id from rhnPackage P where P.id in (%s)
+ </query>
+</write-mode>
+
<write-mode name="add_org_channel_setting">
<query params="org_id, cid, label">
INSERT
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
index 5cab24d..ef2483b 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
@@ -76,6 +76,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.Timer;
/**
* ChannelSoftwareHandler
@@ -1031,7 +1032,7 @@ public class ChannelSoftwareHandler extends BaseHandler {
// Try to add the list of packages to the channel. Catch any exceptions and
// convert to FaultExceptions
try {
- ChannelEditor.getInstance().addPackages(loggedInUser, channel, packageIds);
+ ChannelEditor.getInstance().addPackages(loggedInUser, channel, packageIds);
}
catch (PermissionException e) {
throw new PermissionCheckFailureException();
@@ -1052,7 +1053,6 @@ public class ChannelSoftwareHandler extends BaseHandler {
/* Bugzilla # 177673 */
scheduleErrataCacheUpdate(loggedInUser.getOrg(), channel, 3600000);
-
//if we made it this far, the operation was a success!
return 1;
}
diff --git a/java/code/src/com/redhat/rhn/manager/channel/ChannelEditor.java b/java/code/src/com/redhat/rhn/manager/channel/ChannelEditor.java
index 651ee8a..714f7c2 100644
--- a/java/code/src/com/redhat/rhn/manager/channel/ChannelEditor.java
+++ b/java/code/src/com/redhat/rhn/manager/channel/ChannelEditor.java
@@ -114,19 +114,20 @@ public class ChannelEditor {
List<Long> existingPids = ChannelFactory.getPackageIds(channel.getId());
- //Loop through packages and add to channel.
+ List list = new ArrayList();
for (Iterator itr = packageIds.iterator(); itr.hasNext();) {
Long pid = convertObjectToLong(itr.next());
- List list = new ArrayList();
- list.add(pid);
- if (add && !existingPids.contains(pid)) {
- ChannelManager.addPackages(channel, list, user);
- }
- else if (!add) {
- ChannelManager.removePackages(channel, list, user);
+ if (!existingPids.contains(pid)) {
+ list.add(pid);
}
}
-
+ if (add) {
+ ChannelManager.addPackages(channel, list, user);
+ }
+ else if (!add) {
+ ChannelManager.removePackages(channel, list, user);
+ }
+
// Mark the affected channel to have it smetadata evaluated, where necessary
// (RHEL5+, mostly)
ChannelManager.queueChannelChange(channel.getLabel(), "java::changePackages", null);
diff --git a/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java b/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java
index 48ab715..2324626 100644
--- a/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java
+++ b/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java
@@ -2633,11 +2633,12 @@ public class ChannelManager extends BaseManager {
Map params = new HashMap();
params.put("cid", chan.getId());
- WriteMode m = ModeFactory.getWriteMode("Channel_queries", "add_channel_package");
- for (Long pid : packageIds) {
+ WriteMode m = ModeFactory.getWriteMode("Channel_queries", "add_channel_packages");
+ m.executeUpdate(params, packageIds);
+ /* for (Long pid : packageIds) {
params.put("pid", pid);
m.executeUpdate(params);
- }
+ }*/
HibernateFactory.getSession().refresh(chan);
14 years, 4 months
java/code
by Justin Sherrill
java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/test/ConfigChannelHandlerTest.java | 99 ++++++++++
1 file changed, 99 insertions(+)
New commits:
commit 1b0896d18d1fcc8fa74a5cd02ca2aa46b57695a0
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Fri Jan 15 12:00:01 2010 -0500
adding unit test for ConfigChannelHandler.deployAllSystems
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/test/ConfigChannelHandlerTest.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/test/ConfigChannelHandlerTest.java
index fb29844..2264a5f 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/test/ConfigChannelHandlerTest.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/test/ConfigChannelHandlerTest.java
@@ -17,10 +17,19 @@ package com.redhat.rhn.frontend.xmlrpc.configchannel.test;
import com.redhat.rhn.common.db.datasource.DataResult;
import com.redhat.rhn.common.hibernate.LookupException;
import com.redhat.rhn.common.validator.ValidatorException;
+import com.redhat.rhn.domain.action.ActionFactory;
+import com.redhat.rhn.domain.action.config.ConfigAction;
+import com.redhat.rhn.domain.action.config.ConfigRevisionAction;
import com.redhat.rhn.domain.config.ConfigChannel;
+import com.redhat.rhn.domain.config.ConfigChannelType;
+import com.redhat.rhn.domain.config.ConfigFile;
+import com.redhat.rhn.domain.config.ConfigFileState;
import com.redhat.rhn.domain.config.ConfigFileType;
import com.redhat.rhn.domain.config.ConfigRevision;
+import com.redhat.rhn.domain.config.ConfigurationFactory;
import com.redhat.rhn.domain.server.Server;
+import com.redhat.rhn.domain.server.ServerConstants;
+import com.redhat.rhn.domain.server.ServerFactory;
import com.redhat.rhn.domain.server.test.ServerFactoryTest;
import com.redhat.rhn.frontend.dto.ConfigChannelDto;
import com.redhat.rhn.frontend.dto.ConfigFileDto;
@@ -30,16 +39,22 @@ import com.redhat.rhn.frontend.xmlrpc.serializer.ConfigRevisionSerializer;
import com.redhat.rhn.frontend.xmlrpc.test.BaseHandlerTestCase;
import com.redhat.rhn.manager.action.ActionManager;
import com.redhat.rhn.manager.configuration.ConfigChannelCreationHelper;
+import com.redhat.rhn.manager.system.SystemManager;
+import com.redhat.rhn.manager.system.test.SystemManagerTest;
import com.redhat.rhn.testing.ConfigTestUtils;
import com.redhat.rhn.testing.TestUtils;
+import com.redhat.rhn.testing.UserTestUtils;
import org.apache.commons.lang.RandomStringUtils;
import java.util.ArrayList;
+import java.util.Date;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Set;
/**
* ConfigChannelHandlerTest
@@ -374,5 +389,89 @@ public class ConfigChannelHandlerTest extends BaseHandlerTestCase {
assertEquals(validChannel, 1);
assertEquals(invalidChannel, 0);
}
+
+
+ public void testDeployAllSystems() throws Exception {
+ UserTestUtils.addProvisioning(admin.getOrg());
+
+ // Create global config channels
+ ConfigChannel gcc1 = ConfigTestUtils.createConfigChannel(admin.getOrg(),
+ ConfigChannelType.global());
+ ConfigChannel gcc2 = ConfigTestUtils.createConfigChannel(admin.getOrg(),
+ ConfigChannelType.global());
+
+ Long ver = new Long(2);
+
+ // gcc1 only
+ Server srv1 = ServerFactoryTest.createTestServer(regular, true,
+ ServerConstants.getServerGroupTypeProvisioningEntitled());
+
+ srv1.subscribe(gcc1);
+ srv1.subscribe(gcc2);
+
+ ServerFactory.save(srv1);
+
+ Set <ConfigRevision> revisions = new HashSet<ConfigRevision>();
+
+ ConfigFile g1f1 = gcc1.createConfigFile(
+ ConfigFileState.normal(), "/etc/foo1");
+ revisions.add(ConfigTestUtils.createConfigRevision(g1f1));
+
+ ConfigurationFactory.commit(gcc1);
+
+ ConfigFile g1f2 = gcc1.createConfigFile(
+ ConfigFileState.normal(), "/etc/foo2");
+ revisions.add(ConfigTestUtils.createConfigRevision(g1f2));
+ ConfigurationFactory.commit(gcc2);
+
+ ConfigFile g2f2 = gcc2.createConfigFile(
+ ConfigFileState.normal(), "/etc/foo4");
+ revisions.add(ConfigTestUtils.createConfigRevision(g2f2));
+ ConfigurationFactory.commit(gcc2);
+
+ ConfigFile g2f3 = gcc2.createConfigFile(
+ ConfigFileState.normal(), "/etc/foo3");
+ revisions.add(ConfigTestUtils.createConfigRevision(g2f3));
+ ConfigurationFactory.commit(gcc2);
+
+
+ // System 1 - both g1f1 and g1f2 should deploy here
+ List<Number> systems = new ArrayList<Number>();
+ systems.add(srv1.getId());
+ Date date = new Date();
+
+ try {
+ // validate that system must have config deployment capability
+ // in order to deploy config files... (e.g. rhncfg* pkgs installed)
+ handler.deployAllSystems(regularKey, gcc1.getLabel(), date);
+
+ fail("Shouldn't be permitted to deploy without config deploy capability.");
+ }
+ catch (Exception e) {
+ // Success
+ }
+
+ SystemManagerTest.giveCapability(srv1.getId(),
+ SystemManager.CAP_CONFIGFILES_DEPLOY, ver);
+
+ handler.deployAllSystems(regularKey, gcc1.getLabel(), date);
+
+ DataResult<ScheduledAction> actions = ActionManager.
+ recentlyScheduledActions(regular, null, 1);
+ ConfigAction ca = null;
+ for (ScheduledAction action : actions) {
+ if (ActionFactory.TYPE_CONFIGFILES_DEPLOY.getName().
+ equals(action.getTypeName())) {
+ ca = (ConfigAction)ActionManager.lookupAction(regular,
+ action.getId().longValue());
+ }
+ }
+ assertNotNull(ca);
+ assertEquals(revisions.size(), ca.getConfigRevisionActions().size());
+ for (ConfigRevisionAction cra : ca.getConfigRevisionActions()) {
+ assertTrue(revisions.contains(cra.getConfigRevision()));
+ }
+
+ }
}
14 years, 4 months
java/code
by Justin Sherrill
java/code/src/com/redhat/rhn/domain/token/test/ActivationKeyTest.java | 3 -
java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java | 3 -
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java | 9 +++
java/code/src/com/redhat/rhn/manager/system/UpdateChildChannelsCommand.java | 24 +++++-----
4 files changed, 26 insertions(+), 13 deletions(-)
New commits:
commit 06934155e560c703dcf30a5d91b59c31986c3dc8
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Fri Jan 15 11:10:16 2010 -0500
unit test fixes
diff --git a/java/code/src/com/redhat/rhn/domain/token/test/ActivationKeyTest.java b/java/code/src/com/redhat/rhn/domain/token/test/ActivationKeyTest.java
index 18185e9..35777e4 100644
--- a/java/code/src/com/redhat/rhn/domain/token/test/ActivationKeyTest.java
+++ b/java/code/src/com/redhat/rhn/domain/token/test/ActivationKeyTest.java
@@ -127,7 +127,8 @@ public class ActivationKeyTest extends BaseTestCaseWithUser {
String keyName = " Test Space ";
ActivationKey k = manager.createNewActivationKey
(user, keyName, "Cool Duplicate", null, null, false);
- assertEquals(ActivationKey.makePrefix(user.getOrg()) + keyName.trim(), k.getKey());
+ assertEquals(ActivationKey.makePrefix(user.getOrg()) +
+ keyName.trim().replace(" ", ""), k.getKey());
String newKey = keyName + " FOO ";
manager.changeKey(newKey , k, user);
assertNotNull(ActivationKey.makePrefix(user.getOrg()) + newKey.trim());
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java
index d0a0818..1b37474 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java
@@ -527,7 +527,8 @@ public class ConfigChannelHandler extends BaseHandler {
ConfigChannel channel = configHelper.lookupGlobal(loggedInUser,
channelLabel);
- List<ConfigSystemDto> dtos = manager.listChannelSystems(loggedInUser, channel, null);
+ List<ConfigSystemDto> dtos = manager.listChannelSystems(loggedInUser, channel,
+ null);
List<Server> servers = new ArrayList<Server>();
for (ConfigSystemDto m : dtos) {
Server s = SystemManager.lookupByIdAndUser((Long) m.getId(), loggedInUser);
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java
index a2b3db4..a9be3bb 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java
@@ -78,6 +78,7 @@ import com.redhat.rhn.frontend.dto.PackageMetadata;
import com.redhat.rhn.frontend.dto.ScheduledAction;
import com.redhat.rhn.frontend.dto.ServerPath;
import com.redhat.rhn.frontend.dto.SystemOverview;
+import com.redhat.rhn.frontend.xmlrpc.ChannelSubscriptionException;
import com.redhat.rhn.frontend.xmlrpc.InvalidActionTypeException;
import com.redhat.rhn.frontend.xmlrpc.InvalidChannelException;
import com.redhat.rhn.frontend.xmlrpc.InvalidChannelLabelException;
@@ -270,6 +271,10 @@ public class SystemHandlerTest extends BaseHandlerTestCase {
catch (InvalidChannelException e) {
//success
}
+ catch (ChannelSubscriptionException e) {
+ //success
+ }
+
server = (Server) reload(server);
assertEquals(2, server.getChannels().size());
@@ -360,6 +365,10 @@ public class SystemHandlerTest extends BaseHandlerTestCase {
catch (InvalidChannelException e) {
//success
}
+ catch (ChannelSubscriptionException e) {
+ //success
+ }
+
server = (Server) reload(server);
assertEquals(2, server.getChannels().size());
diff --git a/java/code/src/com/redhat/rhn/manager/system/UpdateChildChannelsCommand.java b/java/code/src/com/redhat/rhn/manager/system/UpdateChildChannelsCommand.java
index 21a6288..9059f59 100644
--- a/java/code/src/com/redhat/rhn/manager/system/UpdateChildChannelsCommand.java
+++ b/java/code/src/com/redhat/rhn/manager/system/UpdateChildChannelsCommand.java
@@ -82,17 +82,19 @@ public class UpdateChildChannelsCommand extends BaseUpdateChannelCommand {
}
}
- // Check whether channelsIds are childs of the current base
- Set subscribableChannelIds = SystemManager.subscribableChannelIds(
- server.getId(), user.getId(), server.getBaseChannel().getId());
- for (Long channelId : cids) {
- if (!subscribableChannelIds.contains(channelId)) {
- Channel channel = ChannelFactory.lookupById(channelId);
- if (channel == null) {
- throw new InvalidChannelException();
- }
- else {
- throw new ChannelSubscriptionException(channel.getLabel());
+ // Check whether channelsIds are childs of the current base if the system has a base
+ if (server.getBaseChannel() != null) {
+ Set subscribableChannelIds = SystemManager.subscribableChannelIds(
+ server.getId(), user.getId(), server.getBaseChannel().getId());
+ for (Long channelId : cids) {
+ if (!subscribableChannelIds.contains(channelId)) {
+ Channel channel = ChannelFactory.lookupById(channelId);
+ if (channel == null) {
+ throw new InvalidChannelException();
+ }
+ else {
+ throw new ChannelSubscriptionException(channel.getLabel());
+ }
}
}
}
14 years, 4 months
java/code
by Justin Sherrill
java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java | 69 ++++++++++
1 file changed, 69 insertions(+)
New commits:
commit 008b7e4d52675ef93b61aec843764ce5497de3f1
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Fri Jan 15 10:31:30 2010 -0500
518127 - adding a configchannel.deployAllSystems api call
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java
index 1d0357b..d0a0818 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java
@@ -23,14 +23,20 @@ import com.redhat.rhn.domain.config.ConfigChannel;
import com.redhat.rhn.domain.config.ConfigChannelType;
import com.redhat.rhn.domain.config.ConfigFile;
import com.redhat.rhn.domain.config.ConfigRevision;
+import com.redhat.rhn.domain.server.Server;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.frontend.dto.ConfigChannelDto;
import com.redhat.rhn.frontend.dto.ConfigFileDto;
+import com.redhat.rhn.frontend.dto.ConfigSystemDto;
import com.redhat.rhn.frontend.xmlrpc.BaseHandler;
+import com.redhat.rhn.manager.MissingCapabilityException;
import com.redhat.rhn.manager.action.ActionManager;
import com.redhat.rhn.manager.configuration.ConfigChannelCreationHelper;
import com.redhat.rhn.manager.configuration.ConfigurationManager;
+import com.redhat.rhn.manager.system.SystemManager;
+import java.util.ArrayList;
+import java.util.Date;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
@@ -477,4 +483,67 @@ public class ConfigChannelHandler extends BaseHandler {
}
return 0;
}
+
+
+ /**
+ * Schedule a configuration deployment for all systems in a config channel immediately
+ * @param sessionKey the session key
+ * @param channelLabel the channel to remove the files from..
+ * @return 1 if successful with the operation errors out otherwise.
+ *
+ *
+ * @xmlrpc.doc Schedule an immediate configuration deployment for all systems
+ * subscribed to a particular configuration channel.
+ * @xmlrpc.param #session_key()
+ * @xmlrpc.param #param_desc("string","channelLabel",
+ * "The configuration channel's label.")
+ * @xmlrpc.returntype #return_int_success()
+ */
+ public int deployAllSystems(String sessionKey, String channelLabel) {
+ return deployAllSystems(sessionKey, channelLabel, new Date());
+ }
+
+
+ /**
+ * Schedule a configuration deployment for all systems in a config channel
+ * @param sessionKey the session key
+ * @param channelLabel the channel to remove the files from..
+ * @param date the date to schedule
+ * @return 1 if successful with the operation errors out otherwise.
+ *
+ *
+ * @xmlrpc.doc Schedule a configuration deployment for all systems
+ * subscribed to a particular configuration channel.
+ * @xmlrpc.param #session_key()
+ * @xmlrpc.param #param_desc("string","channelLabel",
+ * "The configuration channel's label.")
+ * @xmlrpc.param #param_desc($date, "The date to schedule the action")
+ * @xmlrpc.returntype #return_int_success()
+ */
+ public int deployAllSystems(String sessionKey, String channelLabel, Date date) {
+ User loggedInUser = getLoggedInUser(sessionKey);
+ XmlRpcConfigChannelHelper configHelper = XmlRpcConfigChannelHelper.getInstance();
+ ConfigurationManager manager = ConfigurationManager.getInstance();
+
+ ConfigChannel channel = configHelper.lookupGlobal(loggedInUser,
+ channelLabel);
+ List<ConfigSystemDto> dtos = manager.listChannelSystems(loggedInUser, channel, null);
+ List<Server> servers = new ArrayList<Server>();
+ for (ConfigSystemDto m : dtos) {
+ Server s = SystemManager.lookupByIdAndUser((Long) m.getId(), loggedInUser);
+ if (s != null) {
+ servers.add(s);
+ }
+ }
+
+ try {
+ manager.deployConfiguration(loggedInUser, servers, date);
+ }
+ catch (MissingCapabilityException e) {
+ throw new com.redhat.rhn.frontend.xmlrpc.MissingCapabilityException(
+ e.getCapability(), e.getServer());
+ }
+ return 1;
+
+ }
}
14 years, 4 months
Changes to 'refs/tags/spacewalk-backend-0.8.30-1'
by Michael Mraka
Tag 'spacewalk-backend-0.8.30-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2010-01-15 15:24 +0000
Tagging package [spacewalk-backend] version [0.8.30-1] in directory [backend/].
Changes since rhn-client-tools-0.8.3-1:
Michael Mraka (3):
fixed import error
setPermsPath and getUidGid have to be moved to spacewalk.common.fileutils
Automatic commit of package [spacewalk-backend] release [0.8.30-1].
---
backend/common/rhnCache.py | 4 -
backend/common/rhnLib.py | 89 ---------------------------------
backend/common/rhnLog.py | 16 ------
backend/satellite_tools/syncLib.py | 4 -
backend/server/importlib/importLib.py | 3 -
backend/spacewalk-backend.spec | 4 -
backend/spacewalk/common/fileutils.py | 90 ++++++++++++++++++++++++++++++++++
rel-eng/packages/spacewalk-backend | 2
8 files changed, 99 insertions(+), 113 deletions(-)
---
14 years, 4 months
3 commits - backend/common backend/satellite_tools backend/server backend/spacewalk backend/spacewalk-backend.spec rel-eng/packages
by Michael Mraka
backend/common/rhnCache.py | 4 -
backend/common/rhnLib.py | 89 ---------------------------------
backend/common/rhnLog.py | 16 ------
backend/satellite_tools/syncLib.py | 4 -
backend/server/importlib/importLib.py | 3 -
backend/spacewalk-backend.spec | 4 -
backend/spacewalk/common/fileutils.py | 90 ++++++++++++++++++++++++++++++++++
rel-eng/packages/spacewalk-backend | 2
8 files changed, 99 insertions(+), 113 deletions(-)
New commits:
commit c47a0200a6f80789ab403e69ec7900759fe24c48
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jan 15 16:24:56 2010 +0100
Automatic commit of package [spacewalk-backend] release [0.8.30-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index f98a886..34b6c04 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: 0.8.29
+Version: 0.8.30
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -609,7 +609,7 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
-* Fri Jan 15 2010 Michael Mraka <michael.mraka(a)redhat.com> 0.8.29-1
+* Fri Jan 15 2010 Michael Mraka <michael.mraka(a)redhat.com> 0.8.30-1
- added import of rhn-channel-checksum-type
* Thu Jan 14 2010 Michael Mraka <michael.mraka(a)redhat.com> 0.8.28-1
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 09e75e4..1f05ac9 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-0.8.29-1 backend/
+0.8.30-1 backend/
commit ae2cfb868a23ebc466c237f652f6410e666dfd7f
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jan 15 16:22:29 2010 +0100
setPermsPath and getUidGid have to be moved to spacewalk.common.fileutils
due to dependency
diff --git a/backend/common/rhnCache.py b/backend/common/rhnCache.py
index 280609c..bf519d7 100644
--- a/backend/common/rhnCache.py
+++ b/backend/common/rhnCache.py
@@ -26,11 +26,11 @@ from struct import pack
from stat import ST_MTIME
from errno import EEXIST
-from rhnLib import timestamp, setPermsPath
+from rhnLib import timestamp
import rhn_posix
import rhn_fcntl
-from spacewalk.common.fileutils import makedirs
+from spacewalk.common.fileutils import makedirs, setPermsPath
# this is a constant I'm not too happy about but one way or another we have
# to reserve our own shared memory space.
diff --git a/backend/common/rhnLib.py b/backend/common/rhnLib.py
index 14ab93c..545d60e 100644
--- a/backend/common/rhnLib.py
+++ b/backend/common/rhnLib.py
@@ -187,92 +187,3 @@ def startswith(s, prefix):
return s[:len(prefix)] == prefix
-def setPermsPath(path, user='apache', group='root', chmod=0750):
- """chown user.group and set permissions to chmod"""
- if not os.path.exists(path):
- log_error("*** ERROR: Path doesn't exist (can't set permissions): %s" % path)
- sys.exit(-1)
-
- # If non-root, don't bother to change owners
- if os.getuid() != 0:
- return
-
- gc = GecosCache()
- uid = gc.getuid(user)
- if uid is None:
- log_error(messages.missing_user % user)
- sys.exit(-1)
-
- gid = gc.getgid(group)
- if gid is None:
- log_error(messages.missing_group % group)
- sys.exit(-1)
-
- uid_, gid_ = os.stat(path)[4:6]
- if uid_ != uid or gid_ != gid:
- log_debug(3, " Performing 'chown %s.%s %s'" % (user, group, path))
- os.chown(path, uid, gid)
- os.chmod(path, chmod)
-
-class GecosCache:
- "Cache getpwnam() and getgrnam() calls"
- __shared_data = {}
-
- def __init__(self):
- self.__dict__ = self.__shared_data
- if len(self.__shared_data.keys()) == 0:
- # Not initialized
- self._users = {}
- self._groups = {}
-
- def getuid(self, name):
- "Return the UID of the user by name"
- if self._users.has_key(name):
- return self._users[name]
- try:
- uid = pwd.getpwnam(name)[2]
- except KeyError:
- # XXX misa: gripe? taw: I think we need to do something!
- sys.stderr.write("XXX: User %s does not exist\n" % name)
- return None
- self._users[name] = uid
- return uid
-
- def getgid(self, name):
- "Return the GID of the group by name"
- if self._groups.has_key(name):
- return self._groups[name]
- try:
- gid = grp.getgrnam(name)[2]
- except KeyError:
- # XXX misa: gripe?
- sys.stderr.write("XXX: Group %s does not exist\n" % name)
- return None
- self._groups[name] = gid
- return gid
-
- def reset(self):
- self.__shared_data.clear()
- self.__init__()
-
-def getUidGid(user=None, group=None):
- "return uid, gid given user and group"
-
- gc = GecosCache()
- uid = os.getuid()
- if uid != 0:
- # Don't bother to change the owner, it will fail anyway
- # group ownership may work though
- user=None
- else:
- uid = gc.getuid(user)
-
- if group:
- gid = gc.getgid(group)
- else:
- gid = None
-
- if gid is None:
- gid = os.getgid()
- return uid, gid
-
diff --git a/backend/common/rhnLog.py b/backend/common/rhnLog.py
index 0b06af3..fc8d4b8 100644
--- a/backend/common/rhnLog.py
+++ b/backend/common/rhnLog.py
@@ -37,6 +37,7 @@ import string
import traceback
import time
import fcntl
+from spacewalk.common.fileutils import getUidGid
LOG = None
@@ -61,21 +62,6 @@ def log_time():
t = time.strftime("%Y/%m/%d %H:%M:%S", time.localtime(time.time()))
return t + tz_offset_string
-# return a uid and gid for arbitrary username
-def getUidGid(username, groupname):
- # Initialize with some values
- uid = os.getuid()
- gid = uid
- try:
- uid = pwd.getpwnam(username)[2]
- except KeyError:
- sys.stderr.write("*** rhnLog.py ERROR: user '%s' doesn't exist; can't fetch UID." % username)
- try:
- gid = pwd.getpwnam(groupname)[3]
- except KeyError:
- sys.stderr.write("*** rhnLog.py ERROR: user '%s' doesn't exist; can't fetch GID." % groupname)
- return uid, gid
-
# function for setting the close-on-exec flag
def set_close_on_exec(fd):
s = fcntl.fcntl(fd, fcntl.F_GETFD)
diff --git a/backend/satellite_tools/syncLib.py b/backend/satellite_tools/syncLib.py
index 1275020..33000e6 100644
--- a/backend/satellite_tools/syncLib.py
+++ b/backend/satellite_tools/syncLib.py
@@ -25,7 +25,7 @@ from cStringIO import StringIO
# rhn imports:
from common import CFG, log_clean, rhnLib
from common.rhnLog import log_time
-from spacewalk.common.fileutils import createPath
+from spacewalk.common.fileutils import createPath, setPermsPath
import messages
@@ -201,7 +201,7 @@ class FileManip:
fout = open(self.full_path, 'wb')
# setting file permissions; NOTE: rhnpush uses apache to write to disk,
# hence the 6 setting.
- rhnLib.setPermsPath(self.full_path, user='apache', group='apache', chmod=0644)
+ setPermsPath(self.full_path, user='apache', group='apache', chmod=0644)
size = 0
try:
while 1:
diff --git a/backend/server/importlib/importLib.py b/backend/server/importlib/importLib.py
index 5d93e80..d64c1c7 100644
--- a/backend/server/importlib/importLib.py
+++ b/backend/server/importlib/importLib.py
@@ -23,12 +23,11 @@ from UserDict import UserDict
from UserList import UserList
from common import log_debug
-from common.rhnLib import setPermsPath
from server.rhnLib import get_package_path
from spacewalk.common import rhn_mpm
from spacewalk.common.checksum import getFileChecksum
-from spacewalk.common.fileutils import maketemp, createPath
+from spacewalk.common.fileutils import maketemp, createPath, setPermsPath
# no-op class, used to define the type of an attribute
class DateType:
diff --git a/backend/spacewalk/common/fileutils.py b/backend/spacewalk/common/fileutils.py
index f431e1e..83988b9 100644
--- a/backend/spacewalk/common/fileutils.py
+++ b/backend/spacewalk/common/fileutils.py
@@ -331,3 +331,93 @@ def createPath(path, user='apache', group='root', chmod=0755, logging=1):
# Changing permissions failed; ignore the error
sys.stderr.write("Changing owner for %s failed\n" % path)
+
+def setPermsPath(path, user='apache', group='root', chmod=0750):
+ """chown user.group and set permissions to chmod"""
+ if not os.path.exists(path):
+ log_error("*** ERROR: Path doesn't exist (can't set permissions): %s" % path)
+ sys.exit(-1)
+
+ # If non-root, don't bother to change owners
+ if os.getuid() != 0:
+ return
+
+ gc = GecosCache()
+ uid = gc.getuid(user)
+ if uid is None:
+ log_error(messages.missing_user % user)
+ sys.exit(-1)
+
+ gid = gc.getgid(group)
+ if gid is None:
+ log_error(messages.missing_group % group)
+ sys.exit(-1)
+
+ uid_, gid_ = os.stat(path)[4:6]
+ if uid_ != uid or gid_ != gid:
+ log_debug(3, " Performing 'chown %s.%s %s'" % (user, group, path))
+ os.chown(path, uid, gid)
+ os.chmod(path, chmod)
+
+class GecosCache:
+ "Cache getpwnam() and getgrnam() calls"
+ __shared_data = {}
+
+ def __init__(self):
+ self.__dict__ = self.__shared_data
+ if len(self.__shared_data.keys()) == 0:
+ # Not initialized
+ self._users = {}
+ self._groups = {}
+
+ def getuid(self, name):
+ "Return the UID of the user by name"
+ if self._users.has_key(name):
+ return self._users[name]
+ try:
+ uid = pwd.getpwnam(name)[2]
+ except KeyError:
+ # XXX misa: gripe? taw: I think we need to do something!
+ sys.stderr.write("XXX: User %s does not exist\n" % name)
+ return None
+ self._users[name] = uid
+ return uid
+
+ def getgid(self, name):
+ "Return the GID of the group by name"
+ if self._groups.has_key(name):
+ return self._groups[name]
+ try:
+ gid = grp.getgrnam(name)[2]
+ except KeyError:
+ # XXX misa: gripe?
+ sys.stderr.write("XXX: Group %s does not exist\n" % name)
+ return None
+ self._groups[name] = gid
+ return gid
+
+ def reset(self):
+ self.__shared_data.clear()
+ self.__init__()
+
+def getUidGid(user=None, group=None):
+ "return uid, gid given user and group"
+
+ gc = GecosCache()
+ uid = os.getuid()
+ if uid != 0:
+ # Don't bother to change the owner, it will fail anyway
+ # group ownership may work though
+ user=None
+ else:
+ uid = gc.getuid(user)
+
+ if group:
+ gid = gc.getgid(group)
+ else:
+ gid = None
+
+ if gid is None:
+ gid = os.getgid()
+ return uid, gid
+
commit 62ad0ad7c5f22ed99bcea1b1b96383226b945379
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jan 15 16:04:09 2010 +0100
fixed import error
diff --git a/backend/common/rhnCache.py b/backend/common/rhnCache.py
index 781b38c..280609c 100644
--- a/backend/common/rhnCache.py
+++ b/backend/common/rhnCache.py
@@ -26,7 +26,7 @@ from struct import pack
from stat import ST_MTIME
from errno import EEXIST
-from rhnLib import timestamp, makedirs, setPermsPath
+from rhnLib import timestamp, setPermsPath
import rhn_posix
import rhn_fcntl
14 years, 4 months
Changes to 'refs/tags/rhn-client-tools-0.8.3-1'
by Michael Mraka
Tag 'rhn-client-tools-0.8.3-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2010-01-15 14:42 +0000
Tagging package [rhn-client-tools] version [0.8.3-1] in directory [client/rhel/rhn-client-tools/].
Changes since osad-5.9.23-1:
Michael Mraka (1):
Automatic commit of package [rhn-client-tools] release [0.8.3-1].
---
client/rhel/rhn-client-tools/rhn-client-tools.spec | 7 ++++++-
rel-eng/packages/rhn-client-tools | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
---
14 years, 4 months
client/rhel rel-eng/packages
by Michael Mraka
client/rhel/rhn-client-tools/rhn-client-tools.spec | 7 ++++++-
rel-eng/packages/rhn-client-tools | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
New commits:
commit 5c4ee9b3cda574ad4a37dbe41fdc323498e91ecf
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jan 15 15:42:05 2010 +0100
Automatic commit of package [rhn-client-tools] release [0.8.3-1].
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index f0bf203..2fd8015 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -4,7 +4,7 @@ Group: System Environment/Base
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
URL: https://fedorahosted.org/spacewalk
Name: rhn-client-tools
-Version: 0.8.2
+Version: 0.8.3
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%if 0%{?suse_version: %{suse_version} > 1000}
@@ -227,6 +227,11 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/applications/rhn_register.desktop
%changelog
+* Fri Jan 15 2010 Michael Mraka <michael.mraka(a)redhat.com> 0.8.3-1
+- 554317 - fix for gui registration traceback
+- removed dead code
+- 513660 - save / update up2date config during firstboot
+
* Tue Dec 15 2009 Miroslav Suchý <msuchy(a)redhat.com> 0.8.2-1
- 546312 - do not depend on hald for rhnreg_ks
diff --git a/rel-eng/packages/rhn-client-tools b/rel-eng/packages/rhn-client-tools
index 53ce0a7..86b3c69 100644
--- a/rel-eng/packages/rhn-client-tools
+++ b/rel-eng/packages/rhn-client-tools
@@ -1 +1 @@
-0.8.2-1 client/rhel/rhn-client-tools/
+0.8.3-1 client/rhel/rhn-client-tools/
14 years, 4 months