summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Client/Tools')
-rw-r--r--src/lib/Client/Tools/APT.py1
-rw-r--r--src/lib/Client/Tools/DebInit.py4
-rw-r--r--src/lib/Client/Tools/POSIX.py14
-rw-r--r--src/lib/Client/Tools/YUMng.py15
-rw-r--r--src/lib/Client/Tools/__init__.py3
5 files changed, 25 insertions, 12 deletions
diff --git a/src/lib/Client/Tools/APT.py b/src/lib/Client/Tools/APT.py
index d268fe9f4..338ec98fd 100644
--- a/src/lib/Client/Tools/APT.py
+++ b/src/lib/Client/Tools/APT.py
@@ -8,6 +8,7 @@ warnings.filterwarnings("ignore", "apt API not stable yet",
warnings.filterwarnings("ignore", "Accessed deprecated property Package.installedVersion, please see the Version class for alternatives.", DeprecationWarning)
warnings.filterwarnings("ignore", "Accessed deprecated property Package.candidateVersion, please see the Version class for alternatives.", DeprecationWarning)
warnings.filterwarnings("ignore", "Deprecated, please use 'is_installed' instead", DeprecationWarning)
+warnings.filterwarnings("ignore", "Deprecated, please use 'mark_delete()' instead", DeprecationWarning)
warnings.filterwarnings("ignore", "Attribute 'IsUpgradable' of the 'apt_pkg.DepCache' object is deprecated, use 'is_upgradable' instead.", DeprecationWarning)
warnings.filterwarnings("ignore", "Attribute 'VersionList' of the 'apt_pkg.Package' object is deprecated, use 'version_list' instead.", DeprecationWarning)
warnings.filterwarnings("ignore", "Attribute 'VerStr' of the 'apt_pkg.Version' object is deprecated, use 'ver_str' instead.", DeprecationWarning)
diff --git a/src/lib/Client/Tools/DebInit.py b/src/lib/Client/Tools/DebInit.py
index d6ce16c52..022332602 100644
--- a/src/lib/Client/Tools/DebInit.py
+++ b/src/lib/Client/Tools/DebInit.py
@@ -35,10 +35,12 @@ class DebInit(Bcfg2.Client.Tools.SvcTool):
if entry.get('sequence'):
if (deb_version in DEBIAN_OLD_STYLE_BOOT_SEQUENCE or
- deb_version.startswith('5')):
+ deb_version.startswith('5') or
+ os.path.exists('/etc/init.d/.legacy-bootordering')):
start_sequence = int(entry.get('sequence'))
kill_sequence = 100 - start_sequence
else:
+ start_sequence = None
self.logger.warning("Your debian version boot sequence is "
"dependency based \"sequence\" attribute "
"will be ignored.")
diff --git a/src/lib/Client/Tools/POSIX.py b/src/lib/Client/Tools/POSIX.py
index a7a0c4f63..372d4d9e4 100644
--- a/src/lib/Client/Tools/POSIX.py
+++ b/src/lib/Client/Tools/POSIX.py
@@ -115,13 +115,6 @@ class POSIX(Bcfg2.Client.Tools.Tool):
setup.parse([])
ppath = setup['ppath']
max_copies = setup['max_copies']
- """
- Python uses the OS mknod(2) implementation which modifies the mode
- based on the umask of the running process (at least on some Linuxes
- that were tested). We set this to zero so that POSIX-related paths
- will be created as specified in the Bcfg2 configuration.
- """
- os.umask(0)
def canInstall(self, entry):
"""Check if entry is complete for installation."""
@@ -257,6 +250,13 @@ class POSIX(Bcfg2.Client.Tools.Tool):
os.mknod(entry.get('name'), mode, device)
else:
os.mknod(entry.get('name'), mode)
+ """
+ Python uses the OS mknod(2) implementation which modifies the
+ mode based on the umask of the running process. Therefore, the
+ following chmod(2) call is needed to make sure the permissions
+ are set as specified by the user.
+ """
+ os.chmod(entry.get('name'), mode)
os.chown(entry.get('name'), normUid(entry), normGid(entry))
return True
except KeyError:
diff --git a/src/lib/Client/Tools/YUMng.py b/src/lib/Client/Tools/YUMng.py
index 24605ca44..04174b3a1 100644
--- a/src/lib/Client/Tools/YUMng.py
+++ b/src/lib/Client/Tools/YUMng.py
@@ -147,6 +147,14 @@ class YUMng(Bcfg2.Client.Tools.PkgTool):
def __init__(self, logger, setup, config):
self.yb = yum.YumBase()
+
+ if setup['debug']:
+ self.yb.preconf.debuglevel = 3
+ elif setup['verbose']:
+ self.yb.preconf.debuglevel = 2
+ else:
+ self.yb.preconf.debuglevel = 1
+
Bcfg2.Client.Tools.PkgTool.__init__(self, logger, setup, config)
self.ignores = [entry.get('name') for struct in config \
for entry in struct \
@@ -488,9 +496,10 @@ class YUMng(Bcfg2.Client.Tools.PkgTool):
package_fail = True
stat['version_fail'] = True
# Just chose the first pkg for the error message
- self.logger.info(" Wrong version installed. "\
- "Want %s, but have %s" % (nevraString(nevra),
- nevraString(POs[0])))
+ self.logger.info(" %s: Wrong version installed. "
+ "Want %s, but have %s" % (entry.get("name"),
+ nevraString(nevra),
+ nevraString(POs[0])))
qtext_versions.append("U(%s)" % str(POs[0]))
continue
diff --git a/src/lib/Client/Tools/__init__.py b/src/lib/Client/Tools/__init__.py
index 88609c2f6..9d0c69892 100644
--- a/src/lib/Client/Tools/__init__.py
+++ b/src/lib/Client/Tools/__init__.py
@@ -110,7 +110,8 @@ class Tool:
try:
func = getattr(self, "Install%s" % (entry.tag))
states[entry] = func(entry)
- self.modified.append(entry)
+ if states[entry]:
+ self.modified.append(entry)
except:
self.logger.error("Unexpected failure of install method for entry type %s" \
% (entry.tag), exc_info=1)