summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDoug Hellmann <doug.hellmann@dreamhost.com>2013-07-02 15:26:10 -0400
committerDoug Hellmann <doug.hellmann@dreamhost.com>2013-07-02 15:37:20 -0400
commit2f1378ebeaf6188963540a814d9ff418473796bc (patch)
tree2d136e238ab862fbbdd060324197586b7f12b585 /tools
parentafba75f61ba97cfd8c5a90725d060c62e0f045ef (diff)
downloadceilometer-2f1378ebeaf6188963540a814d9ff418473796bc.tar.gz
Fix flake8 errors
Fix exclude rules so we do not run flake8 against code in the build, .tox, or openstack/common directories since this code is not "ours." Fix flake8 errors in other code. Update the config checker script so if there are differences they are printed to the output. This should help track down false negatives in the tests. Change-Id: I9938846943b7f8aab20f02266b870d560c6a2f80 Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/conf/check_uptodate.sh2
-rwxr-xr-xtools/make_test_data.py22
-rwxr-xr-xtools/notificationclient.py26
-rwxr-xr-xtools/release-bugs.py2
-rwxr-xr-xtools/show_data.py12
5 files changed, 32 insertions, 32 deletions
diff --git a/tools/conf/check_uptodate.sh b/tools/conf/check_uptodate.sh
index 10a75b99..0e04a3a3 100755
--- a/tools/conf/check_uptodate.sh
+++ b/tools/conf/check_uptodate.sh
@@ -2,7 +2,7 @@
TMPFILE=`mktemp`
trap "rm -f ${TMPFILE}" EXIT
tools/conf/generate_sample.sh "${TMPFILE}"
-if ! cmp -s "${TMPFILE}" etc/ceilometer/ceilometer.conf.sample
+if ! diff "${TMPFILE}" etc/ceilometer/ceilometer.conf.sample
then
echo "E: ceilometer.conf.sample is not up to date, please run tools/conf/generate_sample.sh"
exit 42
diff --git a/tools/make_test_data.py b/tools/make_test_data.py
index c24c2115..bd1af6c1 100755
--- a/tools/make_test_data.py
+++ b/tools/make_test_data.py
@@ -38,56 +38,56 @@ def main():
parser = argparse.ArgumentParser(
description='generate metering data',
- )
+ )
parser.add_argument(
'--interval',
default=10,
type=int,
help='the period between events, in minutes',
- )
+ )
parser.add_argument(
'--start',
default=31,
help='the number of days in the past to start timestamps',
- )
+ )
parser.add_argument(
'--end',
default=2,
help='the number of days into the future to continue timestamps',
- )
+ )
parser.add_argument(
'--type',
choices=('gauge', 'cumulative'),
default='gauge',
help='counter type',
- )
+ )
parser.add_argument(
'--unit',
default=None,
help='counter unit',
- )
+ )
parser.add_argument(
'--project',
help='project id of owner',
- )
+ )
parser.add_argument(
'--user',
help='user id of owner',
- )
+ )
parser.add_argument(
'resource',
help='the resource id for the meter data',
- )
+ )
parser.add_argument(
'counter',
help='the counter name for the meter data',
- )
+ )
parser.add_argument(
'volume',
help='the amount to attach to the meter',
type=int,
default=1,
- )
+ )
args = parser.parse_args()
# Set up logging to use the console
diff --git a/tools/notificationclient.py b/tools/notificationclient.py
index bb5839c7..33dbcd7b 100755
--- a/tools/notificationclient.py
+++ b/tools/notificationclient.py
@@ -91,24 +91,24 @@ def send_messages(connection, topic, input):
def main():
rpc.register_opts(cfg.CONF)
cfg.CONF.register_opts([
- cfg.StrOpt('datafile',
- default=None,
- help='Data file to read or write',
- ),
- cfg.BoolOpt('record',
- help='Record events',
- ),
- cfg.BoolOpt('replay',
- help='Replay events',
- ),
- ])
+ cfg.StrOpt('datafile',
+ default=None,
+ help='Data file to read or write',
+ ),
+ cfg.BoolOpt('record',
+ help='Record events',
+ ),
+ cfg.BoolOpt('replay',
+ help='Replay events',
+ ),
+ ])
remaining_args = cfg.CONF(sys.argv)
- utils.monkey_patch()
+ #utils.monkey_patch()
parser = argparse.ArgumentParser(
description='record or play back notification events',
- )
+ )
parser.add_argument('mode',
choices=('record', 'replay', 'monitor'),
help='operating mode',
diff --git a/tools/release-bugs.py b/tools/release-bugs.py
index 02cd28ce..a7835283 100755
--- a/tools/release-bugs.py
+++ b/tools/release-bugs.py
@@ -36,7 +36,7 @@ PRE_RELEASE_STATUS = "Fix Released"
RELEASE_PROMPT = (
"Found {bug_count} '{pre_release_status}' bugs for milestone "
"{milestone_title}. Mark them 'Fix Released'? [y/n]: "
- )
+)
def main():
diff --git a/tools/show_data.py b/tools/show_data.py
index af4cfc6a..d3abfc9f 100755
--- a/tools/show_data.py
+++ b/tools/show_data.py
@@ -66,9 +66,9 @@ def show_total_resources(db, args):
print u
for meter in ['disk', 'cpu', 'instance']:
stats = db.get_statistics(storage.SampleFilter(
- user=u,
- meter=meter,
- ))
+ user=u,
+ meter=meter,
+ ))
if meter in ['cpu', 'disk']:
total = stats['max']
else:
@@ -85,7 +85,7 @@ def show_raw(db, args):
for sample in db.get_samples(storage.SampleFilter(
user=u,
resource=resource['resource_id'],
- )):
+ )):
print fmt % sample
@@ -107,7 +107,7 @@ COMMANDS = {
'resources': show_resources,
'total_resources': show_total_resources,
'raw': show_raw,
- }
+}
def main(argv):
@@ -116,7 +116,7 @@ def main(argv):
# NOTE(dhellmann): Read the configuration file(s) for the
#ceilometer collector by default.
default_config_files=['/etc/ceilometer/ceilometer.conf'],
- )
+ )
storage.register_opts(cfg.CONF)
db = storage.get_connection(cfg.CONF)
command = extra_args[0] if extra_args else 'help'