diff --git a/bin/swift-account-info b/bin/swift-account-info index e9ae188dca..41563bcc95 100755 --- a/bin/swift-account-info +++ b/bin/swift-account-info @@ -34,6 +34,7 @@ def run_print_info(args, opts): print('Account info failed: %s' % e) sys.exit(1) + if __name__ == '__main__': parser = OptionParser('%prog [options] ACCOUNT_DB_FILE') parser.add_option( diff --git a/bin/swift-config b/bin/swift-config index 12bcede09c..1a2db221ce 100755 --- a/bin/swift-config +++ b/bin/swift-config @@ -86,5 +86,6 @@ def main(): print('# %s = %s' % (k, v)) print() + if __name__ == "__main__": sys.exit(main()) diff --git a/bin/swift-container-info b/bin/swift-container-info index d832e84fd4..46e5d6f11e 100755 --- a/bin/swift-container-info +++ b/bin/swift-container-info @@ -34,6 +34,7 @@ def run_print_info(args, opts): print('Container info failed: %s' % e) sys.exit(1) + if __name__ == '__main__': parser = OptionParser('%prog [options] CONTAINER_DB_FILE') parser.add_option( diff --git a/bin/swift-oldies b/bin/swift-oldies index dd4eee882e..5614371e9b 100755 --- a/bin/swift-oldies +++ b/bin/swift-oldies @@ -86,4 +86,5 @@ Lists old Swift processes. print('%*s %*s %s' % (hours_len, 'Hours', pid_len, 'PID', 'Command')) for hours, pid, args in listing: - print('%*s %*s %s' % (hours_len, hours, pid_len, pid, args[:args_len])) + print('%*s %*s %s' % (hours_len, hours, pid_len, + pid, args[:args_len])) diff --git a/bin/swift-recon-cron b/bin/swift-recon-cron index d750ba4b28..d9384f313f 100755 --- a/bin/swift-recon-cron +++ b/bin/swift-recon-cron @@ -72,5 +72,6 @@ def main(): print('%s: %s' % (msg, err)) sys.exit(1) + if __name__ == '__main__': main() diff --git a/tox.ini b/tox.ini index 601c9a25f7..c6acc4f53d 100644 --- a/tox.ini +++ b/tox.ini @@ -39,7 +39,7 @@ setenv = VIRTUAL_ENV={envdir} [testenv:pep8] commands = flake8 {posargs:swift test doc setup.py} - flake8 --filename=swift* bin + flake8 --filename=bin/swift* bin python ./setup.py check --restructuredtext --strict bandit -c bandit.yaml -r swift -n 5 ./.manpages {posargs}