java/code
by Tomas Lestach
java/code/src/com/redhat/rhn/domain/server/Server.java | 60 +++++++++++------
1 file changed, 41 insertions(+), 19 deletions(-)
New commits:
commit fedf9076caf9d6e8c269239c4ccb4fb4cd3b40f0
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Jan 6 18:02:12 2011 +0100
628755 - fix searching for the primary network interface
diff --git a/java/code/src/com/redhat/rhn/domain/server/Server.java b/java/code/src/com/redhat/rhn/domain/server/Server.java
index 5ef348e..55e2d78 100644
--- a/java/code/src/com/redhat/rhn/domain/server/Server.java
+++ b/java/code/src/com/redhat/rhn/domain/server/Server.java
@@ -837,25 +837,23 @@ public class Server extends BaseDomainHelper implements Identifiable {
if (!networkInterfaces.isEmpty()) {
Iterator i = networkInterfaces.iterator();
// First pass look for names
- while (i.hasNext()) {
- NetworkInterface n = (NetworkInterface) i.next();
- boolean notEmpty = !n.isDisabled();
- if (n.getName().equals("eth0") && notEmpty) {
- log.debug("Found eth0");
- return n;
- }
- if (n.getName().startsWith("eth0") && notEmpty) {
- log.debug("Found eth0*");
- return n;
- }
- if (n.getName().equals("eth1") && notEmpty) {
- log.debug("Found eth1");
- return n;
- }
- if (n.getName().startsWith("eth1") && notEmpty) {
- log.debug("Found eth1*");
- return n;
- }
+ NetworkInterface ni = null;
+
+ ni = findActiveIfaceWithName("eth0", false);
+ if (ni != null) {
+ return ni;
+ }
+ ni = findActiveIfaceWithName("eth0", true);
+ if (ni != null) {
+ return ni;
+ }
+ ni = findActiveIfaceWithName("eth1", false);
+ if (ni != null) {
+ return ni;
+ }
+ ni = findActiveIfaceWithName("eth1", true);
+ if (ni != null) {
+ return ni;
}
// Second pass look for localhost
i = networkInterfaces.iterator();
@@ -876,6 +874,30 @@ public class Server extends BaseDomainHelper implements Identifiable {
return null;
}
+ private NetworkInterface findActiveIfaceWithName(String pattern, boolean startsWith) {
+ if (networkInterfaces.isEmpty()) {
+ return null;
+ }
+ for (Iterator i = networkInterfaces.iterator(); i.hasNext();) {
+ NetworkInterface ni = (NetworkInterface) i.next();
+ if (ni.isDisabled()) {
+ continue;
+ }
+ if (startsWith) {
+ if (ni.getName().startsWith(pattern)) {
+ log.debug("Found " + pattern + "*");
+ return ni;
+ }
+ }
+ else {
+ if (ni.getName().equals(pattern)) {
+ log.debug("Found " + pattern);
+ return ni;
+ }
+ }
+ }
+ return null;
+ }
// Sometimes java really annoys me
private Network findPrimaryNetwork() {
13 years, 4 months
client/tools
by Miroslav Suchý
client/tools/rhncfg/config_management/rhncfg_diff.py | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit c9a1c617d5ad27745e7c2456d78fa714045008f5
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Jan 6 16:02:59 2011 +0100
634963 - satellites <= 5.4 do not send modified value
diff --git a/client/tools/rhncfg/config_management/rhncfg_diff.py b/client/tools/rhncfg/config_management/rhncfg_diff.py
index 87cb820..da5dcdd 100644
--- a/client/tools/rhncfg/config_management/rhncfg_diff.py
+++ b/client/tools/rhncfg/config_management/rhncfg_diff.py
@@ -148,6 +148,8 @@ class Handler(handler_base.HandlerBase):
return ""
else:
template = "--- %s\t%s\tattributes: %s %s %s %s\tconfig channel: %s\trevision: %s"
+ if not info.has_key('modified'):
+ info['modified'] = ''
first_row = template % (path, str(info['modified']), ostr_to_sym(info['filemode'], info['filetype']),
info['username'], info['groupname'], info['selinux_ctx'], channel,
info['revision'],
13 years, 4 months
2 commits - schema/spacewalk
by Justin Sherrill
schema/spacewalk/common/views/rhnServerFveCapable.sql | 4
schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/015-rhnServerFveCapable.sql | 55 ++++++++++
2 files changed, 57 insertions(+), 2 deletions(-)
New commits:
commit 44bf71c51ba58fbbe24c9346181a831d78d60c08
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Thu Jan 6 09:57:56 2011 -0500
653510 - adding upgrade script for 6566eb4
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/015-rhnServerFveCapable.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/015-rhnServerFveCapable.sql
new file mode 100644
index 0000000..43e589b
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/015-rhnServerFveCapable.sql
@@ -0,0 +1,55 @@
+--
+-- Copyright (c) 2008--2010 Red Hat, Inc.
+--
+-- This software is licensed to you under the GNU General Public License,
+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or
+-- implied, including the implied warranties of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+-- along with this software; if not, see
+-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+--
+-- Red Hat trademarks are not licensed under GPLv2. No permission is
+-- granted to use or replicate Red Hat trademarks that are incorporated
+-- in this software or its documentation.
+--
+--
+--
+--
+-- A view to list systems that fve capable but that are not actually using
+-- and fve entitlement
+create or replace view
+rhnServerFveCapable (
+ server_id,
+ server_org_id,
+ channel_family_id,
+ current_members,
+ max_members,
+ channel_family_name
+)
+as
+select S.id as server_id,
+ S.org_id as server_org_id,
+ cf.id as channel_family_id,
+ pcf.FVE_CURRENT_MEMBERS as current_members,
+ pcf.FVE_MAX_MEMBERS as max_members,
+ cf.name as channel_family_name
+from
+ RhnVirtualInstance vi
+ inner join rhnServer s on vi.virtual_system_id = s.id
+ inner join rhnServerChannel sc on sc.server_id = s.id
+ inner join rhnChannelFamilyMembers cfm on cfm.channel_id = sc.channel_id
+ inner join rhnChannelFamily cf on cf.id = cfm.channel_family_id
+ inner join rhnPrivateChannelFamily pcf on pcf.channel_family_id = cf.id and pcf.org_id = s.org_id
+where sc.is_fve = 'N'
+ AND (vi.host_system_id is null OR
+ not exists (
+ select sg.id
+ from rhnServerGroupMembers sgm
+ inner join rhnServerGroup sg on sgm.server_group_id = sg.id
+ inner join rhnServerGroupType sgt on sgt.id = sg.group_type
+ inner join rhnServer s2 on s2.id = sgm.server_id
+ where
+ s2.id = vi.host_system_id
+ and sgt.label in ('virtualization_host' ,'virtualization_host_platform') )
+ );
+
commit 6566eb4eea3ecf3ba8ead251a670010e9860983f
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Thu Jan 6 09:56:06 2011 -0500
653510 - fixing issue where deleting a virt host that had a virtual entitlement would not properly move its guests to flex entitled if it was available
diff --git a/schema/spacewalk/common/views/rhnServerFveCapable.sql b/schema/spacewalk/common/views/rhnServerFveCapable.sql
index 2f92d1a..43e589b 100644
--- a/schema/spacewalk/common/views/rhnServerFveCapable.sql
+++ b/schema/spacewalk/common/views/rhnServerFveCapable.sql
@@ -42,7 +42,7 @@ from
inner join rhnPrivateChannelFamily pcf on pcf.channel_family_id = cf.id and pcf.org_id = s.org_id
where sc.is_fve = 'N'
AND (vi.host_system_id is null OR
- exists (
+ not exists (
select sg.id
from rhnServerGroupMembers sgm
inner join rhnServerGroup sg on sgm.server_group_id = sg.id
@@ -50,6 +50,6 @@ where sc.is_fve = 'N'
inner join rhnServer s2 on s2.id = sgm.server_id
where
s2.id = vi.host_system_id
- and sgt.label not in ('virtualization_host' ,'virtualization_host_platform') )
+ and sgt.label in ('virtualization_host' ,'virtualization_host_platform') )
);
13 years, 4 months
2 commits - backend/common proxy/proxy
by Miroslav Suchý
backend/common/rhnRepository.py | 11 +----------
proxy/proxy/broker/rhnBroker.py | 2 +-
2 files changed, 2 insertions(+), 11 deletions(-)
New commits:
commit e1642ca32917e66ae8888bb4b220cea174968ad9
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Jan 6 14:37:20 2011 +0100
code cleanup: there is no proxy < 4.1 in real word
diff --git a/backend/common/rhnRepository.py b/backend/common/rhnRepository.py
index 6e5cda4..2257356 100644
--- a/backend/common/rhnRepository.py
+++ b/backend/common/rhnRepository.py
@@ -87,16 +87,7 @@ class Repository(RPC_Base):
# supports redirects.
proxyVersionString = rhnFlags.get('x-rhn-proxy-version')
if proxyVersionString:
- # Convert the version string to a number format that we can compare.
- versionParts = proxyVersionString.split('.')
- proxyVersionStringBaked = \
- "%s.%s" % (versionParts[0], string.join(versionParts[1:], ''))
-
- # Check the proxy version. To maintain backward compatibility, we
- # won't redirect to proxies < v4.1.0.
- log_debug(3, "Detected proxy version " + proxyVersionStringBaked)
- if float(proxyVersionStringBaked) >= 4.1:
- redirectsSupported = 1
+ redirectsSupported = 1
else:
# Must be a client. We'll determine the redirect capability via
# the x-rhn-transport-capability header instead.
commit 342e6cceceb9db546c1e190c65d83574150efb79
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Jan 6 12:55:33 2011 +0100
fix module name during import
addressing:
Exception Handler Information
Traceback (most recent call last):
File "/usr/share/rhn/proxy/apacheServer.py", line 61, in __call__
ret = f(req)
File "/usr/share/rhn/proxy/apacheHandler.py", line 340, in handler
from broker import rhnBroker
File "/usr/share/rhn/proxy/broker/rhnBroker.py", line 32, in ?
from rhnConstants import URI_PREFIX_KS_CHECKSUM
ImportError: No module named rhnConstants
diff --git a/proxy/proxy/broker/rhnBroker.py b/proxy/proxy/broker/rhnBroker.py
index 1621bf3..f6551a6 100644
--- a/proxy/proxy/broker/rhnBroker.py
+++ b/proxy/proxy/broker/rhnBroker.py
@@ -29,7 +29,7 @@ from spacewalk.common.rhnTranslate import _
# local module imports
from proxy.rhnShared import SharedHandler
-from rhnConstants import URI_PREFIX_KS_CHECKSUM
+from proxy.rhnConstants import URI_PREFIX_KS_CHECKSUM
import rhnRepository
import proxy.rhnProxyAuth
13 years, 4 months
Changes to 'refs/tags/rhncfg-5.9.43-1'
by Michael Mraka
Tag 'rhncfg-5.9.43-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2011-01-06 13:24 +0000
Tagging package [rhncfg] version [5.9.43-1] in directory [client/tools/rhncfg/].
Changes since spacewalk-java-1.3.36-1:
Michael Mraka (5):
I wish python had a simple ternary operator
637833 - reused shared file deploy code
637833 - reused shared file deploy code
added deploy module into rpm
Automatic commit of package [rhncfg] release [5.9.43-1].
Tomas Lestach (1):
remove MigrationManagerTest.testRemoveVirtualGuestAssociations test
---
backend/spacewalk/common/fileutils.py | 84 ++--------
client/tools/rhncfg/config_client/rhncfgcli_get.py | 73 --------
client/tools/rhncfg/config_common/Makefile | 2
client/tools/rhncfg/config_common/deploy.py | 84 ++++++++++
client/tools/rhncfg/config_common/file_utils.py | 7
client/tools/rhncfg/config_management/rhncfg_download_channel.py | 11 -
client/tools/rhncfg/config_management/rhncfg_get.py | 2
client/tools/rhncfg/config_management/rpc_repository.py | 4
client/tools/rhncfg/rhncfg.spec | 6
java/code/src/com/redhat/rhn/manager/org/test/MigrationManagerTest.java | 9 -
rel-eng/packages/rhncfg | 2
11 files changed, 127 insertions(+), 157 deletions(-)
---
13 years, 4 months
client/tools rel-eng/packages
by Michael Mraka
client/tools/rhncfg/rhncfg.spec | 6 +++++-
rel-eng/packages/rhncfg | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 9d86b9ee4f87c4893af41542f5674ff76e0acc9c
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Jan 6 14:24:52 2011 +0100
Automatic commit of package [rhncfg] release [5.9.43-1].
diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index b6bc18d..60055b7 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -8,7 +8,7 @@ Group: Applications/System
License: GPLv2 and Python
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.9.42
+Version: 5.9.43
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -100,6 +100,10 @@ rm -rf $RPM_BUILD_ROOT
# $Id$
%changelog
+* Thu Jan 06 2011 Michael Mraka <michael.mraka(a)redhat.com> 5.9.43-1
+- 637833 - reused shared file deploy code
+- 637833 - moved file deploy code into shared module
+
* Mon Jan 03 2011 Tomas Lestach <tlestach(a)redhat.com> 5.9.42-1
- 634963 - adding extra colon (tlestach(a)redhat.com)
diff --git a/rel-eng/packages/rhncfg b/rel-eng/packages/rhncfg
index 1284f3f..f715e39 100644
--- a/rel-eng/packages/rhncfg
+++ b/rel-eng/packages/rhncfg
@@ -1 +1 @@
-5.9.42-1 client/tools/rhncfg/
+5.9.43-1 client/tools/rhncfg/
13 years, 4 months
4 commits - backend/spacewalk client/tools
by Michael Mraka
backend/spacewalk/common/fileutils.py | 84 ++--------
client/tools/rhncfg/config_client/rhncfgcli_get.py | 73 --------
client/tools/rhncfg/config_common/Makefile | 2
client/tools/rhncfg/config_common/deploy.py | 84 ++++++++++
client/tools/rhncfg/config_common/file_utils.py | 7
client/tools/rhncfg/config_management/rhncfg_download_channel.py | 11 -
client/tools/rhncfg/config_management/rhncfg_get.py | 2
client/tools/rhncfg/config_management/rpc_repository.py | 4
8 files changed, 121 insertions(+), 146 deletions(-)
New commits:
commit d63f447bb7242ee0178b89a5024ca72cf4505134
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Jan 6 10:50:05 2011 +0100
added deploy module into rpm
diff --git a/client/tools/rhncfg/config_common/Makefile b/client/tools/rhncfg/config_common/Makefile
index 9853f76..77800d8 100644
--- a/client/tools/rhncfg/config_common/Makefile
+++ b/client/tools/rhncfg/config_common/Makefile
@@ -8,7 +8,7 @@ TOP = ..
# Specific stuff
SUBDIR = config_common
FILES = __init__ cfg_exceptions \
- file_utils \
+ file_utils deploy \
handler_base local_config \
repository rhn_log rhn_main rhn_rpc \
up2date_config_parser utils transactions rpc_wrapper
commit 2272486d9037b0bcead4edf0384f1d47778f8c8b
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Jan 6 10:07:13 2011 +0100
637833 - reused shared file deploy code
diff --git a/client/tools/rhncfg/config_common/deploy.py b/client/tools/rhncfg/config_common/deploy.py
index fb22d62..5fa47eb 100644
--- a/client/tools/rhncfg/config_common/deploy.py
+++ b/client/tools/rhncfg/config_common/deploy.py
@@ -20,7 +20,7 @@ import cfg_exceptions
def deploy_msg_callback(path):
print "Deploying %s" % path
-def deploy_files(topdir, repository, files, excludes = None):
+def deploy_files(topdir, repository, files, excludes = None, config_channel = None):
topdir = topdir or os.sep
if not excludes:
excludes = []
@@ -32,7 +32,12 @@ def deploy_files(topdir, repository, files, excludes = None):
print "Excluding %s" % path
else:
try:
- finfo = repository.get_file_info(path, auto_delete=0, dest_directory=topdir)
+ if config_channel:
+ args = (config_channel, path)
+ else:
+ args = (path, )
+ kwargs = {'auto_delete': 0, 'dest_directory': topdir}
+ finfo = repository.get_file_info(*args, **kwargs)
except cfg_exceptions.DirectoryEntryIsFile, e:
print "Error: unable to deploy directory %s, as it is already a file on disk" % e[0]
continue
diff --git a/client/tools/rhncfg/config_common/file_utils.py b/client/tools/rhncfg/config_common/file_utils.py
index 399ddb7..8acf99f 100644
--- a/client/tools/rhncfg/config_common/file_utils.py
+++ b/client/tools/rhncfg/config_common/file_utils.py
@@ -39,12 +39,13 @@ class FileProcessor:
def process(self, file_struct, directory=None, strict_ownership=1):
# Older servers will not return directories; if filetype is missing,
# assume file
- if directory:
- directory += os.path.split(file_struct['path'])[0]
if file_struct.get('filetype') == 'directory':
- return directory, []
+ file_struct['path'] = directory + file_struct['path']
+ return file_struct['path'], []
+ if directory:
+ directory += os.path.split(file_struct['path'])[0]
if file_struct.get('filetype') == 'symlink':
if not file_struct.has_key('symlink'):
raise Exception, "Missing key symlink"
diff --git a/client/tools/rhncfg/config_management/rhncfg_download_channel.py b/client/tools/rhncfg/config_management/rhncfg_download_channel.py
index 42ea5b4..1068709 100644
--- a/client/tools/rhncfg/config_management/rhncfg_download_channel.py
+++ b/client/tools/rhncfg/config_management/rhncfg_download_channel.py
@@ -16,6 +16,7 @@
import os
from config_common import handler_base, utils
+from config_common.deploy import deploy_files
from config_common.rhn_log import log_debug, die
class Handler(handler_base.HandlerBase):
@@ -47,11 +48,5 @@ class Handler(handler_base.HandlerBase):
if not r.config_channel_exists(ns):
die(6, "Error: config channel %s does not exist" % ns)
- for file_path in r.list_files(ns):
- #5/11/05 wregglej - 157066 dirs_created now gets returned by get_file_info.
- (temp_file, info, dirs_created) = r.get_file_info(ns, file_path)
- dest_file = utils.join_path(topdir, ns, file_path)
- print "Deploying %s -> %s" % (file_path, dest_file)
- utils.copyfile_p(temp_file, dest_file)
- if info['filetype'] != 'symlink':
- utils.set_file_info(dest_file, info)
+ deploy_files(utils.join_path(topdir, ns), r, r.list_files(ns),
+ config_channel=ns)
diff --git a/client/tools/rhncfg/config_management/rhncfg_get.py b/client/tools/rhncfg/config_management/rhncfg_get.py
index ae3556b..99f0204 100644
--- a/client/tools/rhncfg/config_management/rhncfg_get.py
+++ b/client/tools/rhncfg/config_management/rhncfg_get.py
@@ -79,7 +79,7 @@ class Handler(handler_base.HandlerBase):
#5/11/05 wregglej - 157066 dirs_created is returned from get_file_info.
(temp_file, info, dirs_created) = r.get_file_info(channel, f, revision=revision,
- auto_delete=0, directory=dest_dir)
+ auto_delete=0, dest_directory=dest_dir)
except cfg_exceptions.RepositoryFileMissingError:
if revision is not None:
diff --git a/client/tools/rhncfg/config_management/rpc_repository.py b/client/tools/rhncfg/config_management/rpc_repository.py
index eed2901..cb73f3b 100644
--- a/client/tools/rhncfg/config_management/rpc_repository.py
+++ b/client/tools/rhncfg/config_management/rpc_repository.py
@@ -96,7 +96,7 @@ class Repository(repository.RPC_Repository):
raise e
return result
- def get_file_info(self, config_channel, repopath, revision=None, auto_delete=1, directory=tempfile.gettempdir()):
+ def get_file_info(self, config_channel, repopath, revision=None, auto_delete=1, dest_directory=tempfile.gettempdir()):
"""
given a namepath, return the filename and the rest of the info passed
by the server
@@ -104,7 +104,7 @@ class Repository(repository.RPC_Repository):
result = self.get_raw_file_info(config_channel, repopath, revision)
fp = file_utils.FileProcessor()
- fullpath, dirs_created = fp.process(result, directory=directory, strict_ownership=0)
+ fullpath, dirs_created = fp.process(result, directory=dest_directory, strict_ownership=0)
if auto_delete:
self.files_to_delete.append(fullpath)
commit f2d5222dd5eb72653ee6201d87e6571d74e2eb20
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Jan 6 10:07:13 2011 +0100
637833 - reused shared file deploy code
diff --git a/client/tools/rhncfg/config_client/rhncfgcli_get.py b/client/tools/rhncfg/config_client/rhncfgcli_get.py
index bfa426d..b7d3383 100644
--- a/client/tools/rhncfg/config_client/rhncfgcli_get.py
+++ b/client/tools/rhncfg/config_client/rhncfgcli_get.py
@@ -13,79 +13,16 @@
# in this software or its documentation.
#
-import os
-
-from config_common import cfg_exceptions
-from config_common.transactions import DeployTransaction, FailedRollback
-
import handler_base
-
-def deploying_mesg_callback(path):
- print "Deploying %s" % path
+from config_common.deploy import deploy_files
class Handler(handler_base.TopdirHandlerBase):
_usage_options = handler_base.HandlerBase._usage_options + " [ files ... ]"
def run(self):
- topdir = self.options.topdir or os.sep
- dep_trans = DeployTransaction(transaction_root=topdir)
-
- dep_trans.deploy_callback(deploying_mesg_callback)
-
- # Setup the excludes hash
- excludes = {}
- if self.options.exclude is not None:
- for exclude in enumerate(self.options.exclude):
- excludes[exclude[1]] = None
-
- for path in self.get_valid_files():
-
- if excludes.has_key(path):
- print "Excluding %s" % path
- else:
- try:
- finfo = self.repository.get_file_info(path, auto_delete=0, dest_directory=topdir)
- except cfg_exceptions.DirectoryEntryIsFile, e:
- print "Error: unable to deploy directory %s, as it is already a file on disk" % (e[0], )
- continue
-
- if finfo is None:
- # File disappeared since we called the function
- continue
-
- (processed_path, file_info, dirs_created) = finfo
+ deploy_files(self.options.topdir,
+ self.repository,
+ self.get_valid_files(),
+ self.options.exclude)
- try:
- dep_trans.add_preprocessed(path, processed_path, file_info, dirs_created)
- except cfg_exceptions.UserNotFound, e:
- print "Error: unable to deploy file %s, information on user '%s' could not be found." % (path,e[0])
- continue
- except cfg_exceptions.GroupNotFound, e:
- print "Error: unable to deploy file %s, information on group '%s' could not be found." % (path, e[0])
- continue
- try:
- dep_trans.deploy()
- #5/3/05 wregglej - 136415 added missing user exception stuff.
- except cfg_exceptions.UserNotFound, e:
- self.try_rollback(dep_trans, "Error unable to deploy file, information on user '%s' could not be found" % e[0])
- except cfg_exceptions.GroupNotFound, e:
- self.try_rollback(dep_trans, "Error: unable to deploy file, information on group '%s' could not be found" % e[0])
- except cfg_exceptions.FileEntryIsDirectory, e:
- self.try_rollback(dep_trans, "Error: unable to deploy file %s, as it is already a directory on disk" % e[0])
- except cfg_exceptions.DirectoryEntryIsFile, e:
- self.try_rollback(dep_trans, "Error: unable to deploy directory %s, as it is already a file on disk" % e[0])
- except Exception:
- try:
- self.try_rollback(dep_trans, "Deploy failed, rollback successful")
- except:
- print "Failed rollback"
- raise
- def try_rollback(self, dep_trans, msg):
- try:
- dep_trans.rollback()
- except (FailedRollback,
- cfg_exceptions.UserNotFound,
- cfg_exceptions.GroupNotFound), f:
- pass
- print msg
diff --git a/client/tools/rhncfg/config_common/deploy.py b/client/tools/rhncfg/config_common/deploy.py
new file mode 100644
index 0000000..fb22d62
--- /dev/null
+++ b/client/tools/rhncfg/config_common/deploy.py
@@ -0,0 +1,79 @@
+#
+# Copyright (c) 2008--2010 Red Hat, Inc.
+#
+# This software is licensed to you under the GNU General Public License,
+# version 2 (GPLv2). There is NO WARRANTY for this software, express or
+# implied, including the implied warranties of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+# along with this software; if not, see
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+#
+# Red Hat trademarks are not licensed under GPLv2. No permission is
+# granted to use or replicate Red Hat trademarks that are incorporated
+# in this software or its documentation.
+#
+
+from transactions import DeployTransaction, FailedRollback
+import file_utils
+import cfg_exceptions
+
+def deploy_msg_callback(path):
+ print "Deploying %s" % path
+
+def deploy_files(topdir, repository, files, excludes = None):
+ topdir = topdir or os.sep
+ if not excludes:
+ excludes = []
+ dep_trans = DeployTransaction(transaction_root=topdir)
+ dep_trans.deploy_callback(deploy_msg_callback)
+
+ for path in files:
+ if path in excludes:
+ print "Excluding %s" % path
+ else:
+ try:
+ finfo = repository.get_file_info(path, auto_delete=0, dest_directory=topdir)
+ except cfg_exceptions.DirectoryEntryIsFile, e:
+ print "Error: unable to deploy directory %s, as it is already a file on disk" % e[0]
+ continue
+
+ if finfo is None:
+ # File disappeared since we called the function
+ continue
+
+ (processed_path, file_info, dirs_created) = finfo
+ try:
+ dep_trans.add_preprocessed(path, processed_path, file_info, dirs_created)
+ except cfg_exceptions.UserNotFound, e:
+ print "Error: unable to deploy file %s, information on user '%s' could not be found." % (path,e[0])
+ continue
+ except cfg_exceptions.GroupNotFound, e:
+ print "Error: unable to deploy file %s, information on group '%s' could not be found." % (path, e[0])
+ continue
+
+ try:
+ dep_trans.deploy()
+ #5/3/05 wregglej - 136415 added missing user exception stuff.
+ except cfg_exceptions.UserNotFound, e:
+ try_rollback(dep_trans, "Error unable to deploy file, information on user '%s' could not be found" % e[0])
+ except cfg_exceptions.GroupNotFound, e:
+ try_rollback(dep_trans, "Error: unable to deploy file, information on group '%s' could not be found" % e[0])
+ except cfg_exceptions.FileEntryIsDirectory, e:
+ try_rollback(dep_trans, "Error: unable to deploy file %s, as it is already a directory on disk" % e[0])
+ except cfg_exceptions.DirectoryEntryIsFile, e:
+ try_rollback(dep_trans, "Error: unable to deploy directory %s, as it is already a file on disk" % e[0])
+ except Exception:
+ try:
+ try_rollback(dep_trans, "Deploy failed, rollback successful")
+ except:
+ print "Failed rollback"
+ raise
+
+def try_rollback(dep_trans, msg):
+ try:
+ dep_trans.rollback()
+ except (FailedRollback,
+ cfg_exceptions.UserNotFound,
+ cfg_exceptions.GroupNotFound), f:
+ pass
+ print msg
commit 446eb494456bf4b76bb87c936085b74edace6b00
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Jan 6 10:40:39 2011 +0100
I wish python had a simple ternary operator
diff --git a/backend/spacewalk/common/fileutils.py b/backend/spacewalk/common/fileutils.py
index 84559b9..c22d421 100644
--- a/backend/spacewalk/common/fileutils.py
+++ b/backend/spacewalk/common/fileutils.py
@@ -384,6 +384,12 @@ FILETYPE2CHAR = {
'blockdev' : 'b',
}
+def _ifelse(cond, thenval, elseval):
+ if cond:
+ return thenval
+ else:
+ return elseval
+
def ostr_to_sym(octstr, ftype):
""" Convert filemode in octets (like '644') to string like "ls -l" ("-rwxrw-rw-")
ftype is one of: file, directory, symlink, chardev, blockdev.
@@ -392,69 +398,21 @@ def ostr_to_sym(octstr, ftype):
symstr = FILETYPE2CHAR.get(ftype, '?')
- if mode & stat.S_IRUSR:
- symstr += 'r'
- else:
- symstr += '-'
-
- if mode & stat.S_IWUSR:
- symstr += 'w'
- else:
- symstr += '-'
-
- if mode & stat.S_IXUSR:
- if mode & stat.S_ISUID:
- symstr += 's'
- else:
- symstr += 'x'
- else:
- if mode & stat.S_ISUID:
- symstr += 'S'
- else:
- symstr += '-'
-
- if mode & stat.S_IRGRP:
- symstr += 'r'
- else:
- symstr += '-'
-
- if mode & stat.S_IWGRP:
- symstr += 'w'
- else:
- symstr += '-'
-
- if mode & stat.S_IXGRP:
- if mode & stat.S_ISGID:
- symstr += 's'
- else:
- symstr += 'x'
- else:
- if mode & stat.S_ISGID:
- symstr += 'S'
- else:
- symstr += '-'
-
- if mode & stat.S_IROTH:
- symstr += 'r'
- else:
- symstr += '-'
-
- if mode & stat.S_IWOTH:
- symstr += 'w'
- else:
- symstr += '-'
-
- if mode & stat.S_IXOTH:
- if mode & stat.S_ISVTX:
- symstr += 't'
- else:
- symstr += 'x'
- else:
- if mode & stat.S_ISVTX:
- symstr += 'T'
- else:
- symstr += '-'
-
+ symstr += _ifelse(mode & stat.S_IRUSR, 'r', '-')
+ symstr += _ifelse(mode & stat.S_IWUSR, 'w', '-')
+ symstr += _ifelse(mode & stat.S_IXUSR,
+ _ifelse(mode & stat.S_ISUID, 's', 'x'),
+ _ifelse(mode & stat.S_ISUID, 'S', '-'))
+ symstr += _ifelse(mode & stat.S_IRGRP, 'r', '-')
+ symstr += _ifelse(mode & stat.S_IWGRP, 'w', '-')
+ symstr += _ifelse(mode & stat.S_IXGRP,
+ _ifelse(mode & stat.S_ISGID, 's', 'x'),
+ _ifelse(mode & stat.S_ISGID, 'S', '-'))
+ symstr += _ifelse(mode & stat.S_IROTH, 'r', '-')
+ symstr += _ifelse(mode & stat.S_IWOTH, 'w', '-')
+ symstr += _ifelse(mode & stat.S_IXOTH,
+ _ifelse(mode & stat.S_ISVTX, 't', 'x'),
+ _ifelse(mode & stat.S_ISVTX, 'T', '-'))
return symstr
def f_date(dbiDate):
13 years, 4 months
java/code
by Tomas Lestach
java/code/src/com/redhat/rhn/manager/org/test/MigrationManagerTest.java | 9 ---------
1 file changed, 9 deletions(-)
New commits:
commit 9c88fbded85fd1219a6131e2dab207fea6cd94ce
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Jan 6 13:52:34 2011 +0100
remove MigrationManagerTest.testRemoveVirtualGuestAssociations test
test doesn't make sence, since we support having host and virt guests in different orgs
diff --git a/java/code/src/com/redhat/rhn/manager/org/test/MigrationManagerTest.java b/java/code/src/com/redhat/rhn/manager/org/test/MigrationManagerTest.java
index f2995f7..9bae0d3 100644
--- a/java/code/src/com/redhat/rhn/manager/org/test/MigrationManagerTest.java
+++ b/java/code/src/com/redhat/rhn/manager/org/test/MigrationManagerTest.java
@@ -159,15 +159,6 @@ public class MigrationManagerTest extends RhnBaseTestCase {
assertEquals(0, server2.getConfigChannelCount());
}
- public void testRemoveVirtualGuestAssociations() throws Exception {
- assertTrue(server.getGuests().size() > 0);
-
- MigrationManager.removeOrgRelationships(origOrgAdmins.iterator().next(), server);
- server = (Server) reload(server);
-
- assertEquals(0, server.getGuests().size());
- }
-
public void testRemoveMonitoringProbeSuites() throws Exception {
User origOrgAdmin = origOrgAdmins.iterator().next();
13 years, 4 months
Changes to 'refs/tags/spacewalk-java-1.3.36-1'
by Tomas Lestach
Tag 'spacewalk-java-1.3.36-1' created by Tomas Lestach <tlestach(a)redhat.com> at 2011-01-06 10:00 +0000
Tagging package [spacewalk-java] version [1.3.36-1] in directory [java/].
Changes since spacewalk-java-1.3.35-1:
Tomas Lestach (2):
removing unused import
Automatic commit of package [spacewalk-java] release [1.3.36-1].
---
java/code/src/com/redhat/rhn/manager/org/MigrationManager.java | 1 -
java/spacewalk-java.spec | 5 ++++-
rel-eng/packages/spacewalk-java | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
---
13 years, 4 months
java/spacewalk-java.spec rel-eng/packages
by Tomas Lestach
java/spacewalk-java.spec | 5 ++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit d72bcf5a936f1de44cb8a3f3da1409ec462d1a99
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Jan 6 11:00:20 2011 +0100
Automatic commit of package [spacewalk-java] release [1.3.36-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index d03bc3c..ce16619 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -17,7 +17,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.3.35
+Version: 1.3.36
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -456,6 +456,9 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Thu Jan 06 2011 Tomas Lestach <tlestach(a)redhat.com> 1.3.36-1
+- removing unused import (tlestach(a)redhat.com)
+
* Wed Jan 05 2011 Tomas Lestach <tlestach(a)redhat.com> 1.3.35-1
- 663490 - identify, when package is too large to download via API
(tlestach(a)redhat.com)
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index e9444be..cbbe552 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.3.35-1 java/
+1.3.36-1 java/
13 years, 4 months