summaryrefslogtreecommitdiffstats
path: root/src/sbin
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-03-26 12:47:14 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-03-26 12:47:14 -0400
commit64eec5fe6a9b640bb77dd65f10f3fac5a586347c (patch)
tree3b3c86bda461ff2232b9f30b0d1e873f2b6a1b9a /src/sbin
parent9673ba716310f50855cba74195e53878316af886 (diff)
downloadbcfg2-64eec5fe6a9b640bb77dd65f10f3fac5a586347c.tar.gz
bcfg2-64eec5fe6a9b640bb77dd65f10f3fac5a586347c.tar.bz2
bcfg2-64eec5fe6a9b640bb77dd65f10f3fac5a586347c.zip
testsuite: fixed issues found by latest version of pep8
Diffstat (limited to 'src/sbin')
-rwxr-xr-xsrc/sbin/bcfg2-crypt6
-rwxr-xr-xsrc/sbin/bcfg2-info29
-rwxr-xr-xsrc/sbin/bcfg2-report-collector10
3 files changed, 21 insertions, 24 deletions
diff --git a/src/sbin/bcfg2-crypt b/src/sbin/bcfg2-crypt
index eae316da5..aad89882f 100755
--- a/src/sbin/bcfg2-crypt
+++ b/src/sbin/bcfg2-crypt
@@ -161,8 +161,8 @@ class Encryptor(object):
continue
except TypeError:
pchunk = None
- for pname, passphrase in \
- Bcfg2.Encryption.get_passphrases(self.setup).items():
+ passphrases = Bcfg2.Encryption.get_passphrases(self.setup)
+ for pname, passphrase in passphrases.items():
self.logger.debug("Trying passphrase %s" % pname)
try:
pchunk = self._decrypt(chunk, passphrase)
@@ -341,7 +341,7 @@ class PropertiesEncryptor(Encryptor):
# actually need to unchunk anything
xdata = data[0]
# find root element
- while xdata.getparent() != None:
+ while xdata.getparent() is not None:
xdata = xdata.getparent()
return lxml.etree.tostring(xdata,
xml_declaration=False,
diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info
index cfcc95be2..462d41398 100755
--- a/src/sbin/bcfg2-info
+++ b/src/sbin/bcfg2-info
@@ -380,7 +380,7 @@ Bcfg2 client itself.""")
xml_declaration=False).decode('UTF-8')
except Exception:
print("Failed to build entry %s for host %s: %s" %
- (fname, client, traceback.format_exc().splitlines()[-1]))
+ (fname, client, traceback.format_exc().splitlines()[-1]))
raise
try:
if outfile:
@@ -468,19 +468,18 @@ Bcfg2 client itself.""")
def do_config(self, _):
""" config - Print out the current configuration of Bcfg2"""
output = [
- ('Description', 'Value'),
- ('Path Bcfg2 repository', self.setup['repo']),
- ('Plugins', self.setup['plugins']),
- ('Password', self.setup['password']),
- ('Server Metadata Connector', self.setup['mconnect']),
- ('Filemonitor', self.setup['filemonitor']),
- ('Server address', self.setup['location']),
- ('Path to key', self.setup['key']),
- ('Path to SSL certificate', self.setup['cert']),
- ('Path to SSL CA certificate', self.setup['ca']),
- ('Protocol', self.setup['protocol']),
- ('Logging', self.setup['logging'])
- ]
+ ('Description', 'Value'),
+ ('Path Bcfg2 repository', self.setup['repo']),
+ ('Plugins', self.setup['plugins']),
+ ('Password', self.setup['password']),
+ ('Server Metadata Connector', self.setup['mconnect']),
+ ('Filemonitor', self.setup['filemonitor']),
+ ('Server address', self.setup['location']),
+ ('Path to key', self.setup['key']),
+ ('Path to SSL certificate', self.setup['cert']),
+ ('Path to SSL CA certificate', self.setup['ca']),
+ ('Protocol', self.setup['protocol']),
+ ('Logging', self.setup['logging'])]
print_tabular(output)
def do_probes(self, args):
@@ -739,7 +738,7 @@ def build_usage():
# shim for python 2.4, __func__ is im_func
funcattr = getattr(attr, "__func__", getattr(attr, "im_func", None))
- if (funcattr != None and
+ if (funcattr is not None and
funcattr.func_name not in cmd_blacklist and
funcattr.func_name.startswith("do_") and
funcattr.func_doc):
diff --git a/src/sbin/bcfg2-report-collector b/src/sbin/bcfg2-report-collector
index a0ee2259a..594be13bf 100755
--- a/src/sbin/bcfg2-report-collector
+++ b/src/sbin/bcfg2-report-collector
@@ -12,12 +12,10 @@ from Bcfg2.Reporting.Collector import ReportingCollector, ReportingError
def main():
logger = logging.getLogger('bcfg2-report-collector')
- optinfo = dict(
- daemon=Bcfg2.Options.DAEMON,
- repo=Bcfg2.Options.SERVER_REPOSITORY,
- filemonitor=Bcfg2.Options.SERVER_FILEMONITOR,
- web_configfile=Bcfg2.Options.WEB_CFILE,
- )
+ optinfo = dict(daemon=Bcfg2.Options.DAEMON,
+ repo=Bcfg2.Options.SERVER_REPOSITORY,
+ filemonitor=Bcfg2.Options.SERVER_FILEMONITOR,
+ web_configfile=Bcfg2.Options.WEB_CFILE)
optinfo.update(Bcfg2.Options.CLI_COMMON_OPTIONS)
optinfo.update(Bcfg2.Options.REPORTING_COMMON_OPTIONS)
setup = Bcfg2.Options.OptionParser(optinfo)