From d398edf58679413af7ec85a4828368a2c6c10248 Mon Sep 17 00:00:00 2001 From: igorwidlinski Date: Thu, 4 Jul 2013 10:05:57 -0700 Subject: Stop adding chkconfig service to every run level Let chkconfig assign default runlevels. --- src/lib/Bcfg2/Client/Tools/Chkconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Client') diff --git a/src/lib/Bcfg2/Client/Tools/Chkconfig.py b/src/lib/Bcfg2/Client/Tools/Chkconfig.py index edcc86b85..4833f3f68 100644 --- a/src/lib/Bcfg2/Client/Tools/Chkconfig.py +++ b/src/lib/Bcfg2/Client/Tools/Chkconfig.py @@ -89,7 +89,7 @@ class Chkconfig(Bcfg2.Client.Tools.SvcTool): if bootstatus is not None: if bootstatus == 'on': # make sure service is enabled on boot - bootcmd = '/sbin/chkconfig %s %s --level 0123456' % \ + bootcmd = '/sbin/chkconfig %s %s' % \ (entry.get('name'), bootstatus) elif bootstatus == 'off': # make sure service is disabled on boot -- cgit v1.2.3-1-g7c22 From 6b0b45842b138a928f7d5e395f7a21f9ad932f2a Mon Sep 17 00:00:00 2001 From: Tim Laszlo Date: Wed, 10 Jul 2013 10:09:24 -0500 Subject: Copy xml elements before appending to tree. This prevents modified entries from being added --- src/lib/Bcfg2/Client/Frame.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Client') diff --git a/src/lib/Bcfg2/Client/Frame.py b/src/lib/Bcfg2/Client/Frame.py index 3254da9e9..1b26450a6 100644 --- a/src/lib/Bcfg2/Client/Frame.py +++ b/src/lib/Bcfg2/Client/Frame.py @@ -1,6 +1,7 @@ """ Frame is the Client Framework that verifies and installs entries, and generates statistics. """ +import copy import time import fnmatch import logging @@ -522,7 +523,7 @@ class Frame(object): container = Bcfg2.Client.XML.SubElement(stats, ename) for item in data: item.set('qtext', '') - container.append(item) + container.append(copy.deepcopy(item)) item.text = None timeinfo = Bcfg2.Client.XML.Element("OpStamps") -- cgit v1.2.3-1-g7c22 From ba6e31eba192d6fcfc31d2f8ab2ad811a1322f62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Fri, 12 Jul 2013 00:19:38 -0400 Subject: Don't crash when a file diff contains utf-8 chars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a crash when the client tries to render the diff of a file which includes unicode characters. This change assumes that utf-8 is the default encoding, which looking at the rest of the code appears to be a safe bet. Signed-off-by: Stéphane Graber --- src/lib/Bcfg2/Client/__init__.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lib/Bcfg2/Client') diff --git a/src/lib/Bcfg2/Client/__init__.py b/src/lib/Bcfg2/Client/__init__.py index 25603186e..6d1cb9d40 100644 --- a/src/lib/Bcfg2/Client/__init__.py +++ b/src/lib/Bcfg2/Client/__init__.py @@ -21,6 +21,9 @@ def prompt(msg): try: ans = input(msg) return ans in ['y', 'Y'] + except UnicodeEncodeError: + ans = input(msg.encode('utf-8')) + return ans in ['y', 'Y'] except EOFError: # handle ^C on rhel-based platforms raise SystemExit(1) -- cgit v1.2.3-1-g7c22 From 1209f76d4a8b64c157331f2c7dfad1bf60a09ded Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Tue, 16 Jul 2013 11:23:00 -0400 Subject: POSIXUsers: remove usermod -m option, which is too new --- src/lib/Bcfg2/Client/Tools/POSIXUsers.py | 1 - 1 file changed, 1 deletion(-) (limited to 'src/lib/Bcfg2/Client') diff --git a/src/lib/Bcfg2/Client/Tools/POSIXUsers.py b/src/lib/Bcfg2/Client/Tools/POSIXUsers.py index 8226392f9..bb684899d 100644 --- a/src/lib/Bcfg2/Client/Tools/POSIXUsers.py +++ b/src/lib/Bcfg2/Client/Tools/POSIXUsers.py @@ -249,7 +249,6 @@ class POSIXUsers(Bcfg2.Client.Tools.Tool): if entry.get('gid'): cmd.extend(['-g', entry.get('gid')]) elif entry.tag == 'POSIXUser': - cmd.append('-m') if entry.get('uid'): cmd.extend(['-u', entry.get('uid')]) cmd.extend(['-g', entry.get('group')]) -- cgit v1.2.3-1-g7c22 From 610b556a908e6782504aa4ec466f819b31303154 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 17 Jul 2013 15:26:56 +0200 Subject: Bcfg2/Client/Tools: do not get bootstatus directly from the entry Bootstatus is optional and should have the value of status if not specified. This is handled by get_bootstatus. --- src/lib/Bcfg2/Client/Tools/DebInit.py | 2 +- src/lib/Bcfg2/Client/Tools/RcUpdate.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/Bcfg2/Client') diff --git a/src/lib/Bcfg2/Client/Tools/DebInit.py b/src/lib/Bcfg2/Client/Tools/DebInit.py index 761c51db7..b544e44d4 100644 --- a/src/lib/Bcfg2/Client/Tools/DebInit.py +++ b/src/lib/Bcfg2/Client/Tools/DebInit.py @@ -108,7 +108,7 @@ class DebInit(Bcfg2.Client.Tools.SvcTool): def InstallService(self, entry): """Install Service entry.""" self.logger.info("Installing Service %s" % (entry.get('name'))) - bootstatus = entry.get('bootstatus') + bootstatus = self.get_bootstatus(entry) # check if init script exists try: diff --git a/src/lib/Bcfg2/Client/Tools/RcUpdate.py b/src/lib/Bcfg2/Client/Tools/RcUpdate.py index 8e9626521..e0c913dcd 100644 --- a/src/lib/Bcfg2/Client/Tools/RcUpdate.py +++ b/src/lib/Bcfg2/Client/Tools/RcUpdate.py @@ -89,7 +89,7 @@ class RcUpdate(Bcfg2.Client.Tools.SvcTool): def InstallService(self, entry): """Install Service entry.""" self.logger.info('Installing Service %s' % entry.get('name')) - bootstatus = entry.get('bootstatus') + bootstatus = self.get_bootstatus(entry) if bootstatus is not None: if bootstatus == 'on': # make sure service is enabled on boot -- cgit v1.2.3-1-g7c22