summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2009-10-16 03:07:16 +0000
committerSol Jerome <solj@ices.utexas.edu>2009-10-16 03:07:16 +0000
commitf504983c5a4874dd953c112b1d62b5db71d336d9 (patch)
tree3aa97146ec32997bdf0431ea7b860a1ead6a0d41 /src/lib
parent734e9b1f1d67680036651a8dd2c86fe77e9de9d9 (diff)
downloadbcfg2-f504983c5a4874dd953c112b1d62b5db71d336d9.tar.gz
bcfg2-f504983c5a4874dd953c112b1d62b5db71d336d9.tar.bz2
bcfg2-f504983c5a4874dd953c112b1d62b5db71d336d9.zip
POSIX: Add support for all new POSIX types in the client code
The client should now understand old and new POSIX entries. It is compatible with 0.9.6, 1.0 using POSIXCompat, and new 1.0 Path entries. Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5485 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Client/Tools/POSIX.py51
1 files changed, 48 insertions, 3 deletions
diff --git a/src/lib/Client/Tools/POSIX.py b/src/lib/Client/Tools/POSIX.py
index 7457ca480..73fc64af1 100644
--- a/src/lib/Client/Tools/POSIX.py
+++ b/src/lib/Client/Tools/POSIX.py
@@ -89,12 +89,17 @@ class POSIX(Bcfg2.Client.Tools.Tool):
__handles__ = [('ConfigFile', None),
('Directory', None),
('Path', 'ConfigFile'),
- ('Path', 'device'),
('Path', 'Directory'),
('Path', 'HardLink'),
('Path', 'Permissions'),
('Path', 'SymLink'),
+ ('Path', 'device'),
+ ('Path', 'directory'),
+ ('Path', 'file'),
+ ('Path', 'hardlink'),
('Path', 'nonexistent'),
+ ('Path', 'permissions'),
+ ('Path', 'symlink'),
('Permissions', None),
('SymLink', None)]
__req__ = {'ConfigFile': ['name', 'owner', 'group', 'perms'],
@@ -324,7 +329,7 @@ class POSIX(Bcfg2.Client.Tools.Tool):
return False
return self.InstallPermissions(entry)
- def VerifyHardLink(self, entry, _):
+ def VerifyhardLink(self, entry, _):
'''Verify HardLink Entry'''
try:
if os.path.samefile(entry.get('name'), entry.get('to')):
@@ -342,7 +347,7 @@ class POSIX(Bcfg2.Client.Tools.Tool):
entry.get('to')))
return False
- def InstallHardLink(self, entry):
+ def InstallhardLink(self, entry):
'''Install HardLink Entry'''
self.logger.info("Installing Hardlink %s" % (entry.get('name')))
if os.path.lexists(entry.get('name')):
@@ -678,6 +683,46 @@ class POSIX(Bcfg2.Client.Tools.Tool):
print(err)
return False
+ def Verifydirectory(self, entry, _):
+ ret = getattr(self, 'VerifyDirectory')
+ return ret(entry, _)
+
+ def Installdirectory(self, entry):
+ ret = getattr(self, 'InstallDirectory')
+ return ret(entry)
+
+ def Verifyfile(self, entry, _):
+ ret = getattr(self, 'VerifyConfigFile')
+ return ret(entry, _)
+
+ def Installfile(self, entry):
+ ret = getattr(self, 'InstallConfigFile')
+ return ret(entry)
+
+ def Verifynonexistent(self, entry, _):
+ # FIXME: not implemented
+ return True
+
+ def Installnonexistent(self, entry):
+ # FIXME: not implemented
+ return True
+
+ def Verifypermissions(self, entry, _):
+ ret = getattr(self, 'VerifyPermissions')
+ return ret(entry, _)
+
+ def Installpermissions(self, entry):
+ ret = getattr(self, 'InstallPermissions')
+ return ret(entry)
+
+ def Verifysymlink(self, entry, _):
+ ret = getattr(self, 'VerifySymLink')
+ return ret(entry, _)
+
+ def Installsymlink(self, entry):
+ ret = getattr(self, 'InstallSymLink')
+ return ret(entry)
+
def InstallPath(self, entry):
ret = getattr(self, 'Install%s' % entry.get('type'))
return ret(entry)