summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2016-11-21 19:20:25 +0100
committerAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2016-11-21 19:31:12 +0100
commitcc1dc22226b74eae13973aea1e1ae6db478f2c66 (patch)
tree53ff03074486ca5654c42e422eaf1a2f29373901 /src/lib
parent05c6c143d70f5a9ec1fb5d508713176e1bd97063 (diff)
downloadbcfg2-cc1dc22226b74eae13973aea1e1ae6db478f2c66.tar.gz
bcfg2-cc1dc22226b74eae13973aea1e1ae6db478f2c66.tar.bz2
bcfg2-cc1dc22226b74eae13973aea1e1ae6db478f2c66.zip
Server/Lint: Fix code style
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Bcfg2/Server/Lint/RequiredAttrs.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py b/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py
index ec65af650..3f1157912 100644
--- a/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py
+++ b/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py
@@ -47,6 +47,13 @@ def is_device_mode(val):
return re.match(r'^\d+$', val)
+def is_vcs_type(val):
+ """ Return True if val is a supported vcs type handled by the
+ current client tool """
+ return (val != 'Path' and
+ hasattr(Bcfg2.Client.Tools.VCS.VCS, 'Install%s' % val))
+
+
class RequiredAttrs(Bcfg2.Server.Lint.ServerPlugin):
""" Verify attributes for configuration entries that cannot be
verified with an XML schema alone. """
@@ -71,10 +78,8 @@ class RequiredAttrs(Bcfg2.Server.Lint.ServerPlugin):
'nonexistent': dict(),
'permissions': dict(owner=is_username, group=is_username,
mode=is_octal_mode),
- 'vcs': dict(vcstype=lambda v: (v != 'Path' and
- hasattr(Bcfg2.Client.Tools.VCS.VCS,
- "Install%s" % v)),
- revision=None, sourceurl=None),
+ 'vcs': dict(vcstype=is_vcs_type, revision=None,
+ sourceurl=None),
},
Service={"__any__": dict(name=None),
"smf": dict(name=None, FMRI=None)},