]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Add heat-watch to pep8 checks
authorSteven Dake <sdake@redhat.com>
Wed, 27 Feb 2013 17:39:54 +0000 (10:39 -0700)
committerGerrit Code Review <review@openstack.org>
Thu, 28 Feb 2013 20:20:04 +0000 (20:20 +0000)
heat-watch was missing from pep8 checks in the past.  Tidy up heat-watch
and add to run_pep8.sh.

Change-Id: I36680b24ee90a5daeb7f8d7418b665a215026325
Fixes: Bug #1131275
bin/heat-watch
tools/run_pep8.sh

index ff67ee890102e0807aa23251c823c120a2e7e3ed..e1167f5e88348298270c79e6d9066d529ffe0943 100755 (executable)
@@ -46,7 +46,8 @@ from heat.common import config
 from heat.common import exception
 from heat.cfn_client import utils
 
-DEFAULT_PORT=8003
+DEFAULT_PORT = 8003
+
 
 @utils.catch_error('alarm-describe')
 def alarm_describe(options, arguments):
@@ -54,7 +55,7 @@ def alarm_describe(options, arguments):
     Describe detail for specified alarm, or all alarms
     if no AlarmName is specified
     '''
-    parameters={}
+    parameters = {}
     try:
         parameters['AlarmName'] = arguments.pop(0)
     except IndexError:
@@ -64,16 +65,17 @@ def alarm_describe(options, arguments):
     result = c.describe_alarm(**parameters)
     print c.format_metric_alarm(result)
 
+
 @utils.catch_error('alarm-set-state')
 def alarm_set_state(options, arguments):
     '''
     Temporarily set state for specified alarm
     '''
     usage = ('''Usage:
-%s alarm-set-state AlarmName StateValue [StateReason]''' %
-        (scriptname))
+             %s alarm-set-state AlarmName StateValue [StateReason]''' %
+             (scriptname))
 
-    parameters={}
+    parameters = {}
     try:
         parameters['AlarmName'] = arguments.pop(0)
         parameters['StateValue'] = arguments.pop(0)
@@ -81,7 +83,7 @@ def alarm_set_state(options, arguments):
         logging.error("Must specify AlarmName and StateValue")
         print usage
         print "StateValue must be one of %s, %s or %s" % (
-                      heat_client.BotoCWClient.ALARM_STATES)
+            heat_client.BotoCWClient.ALARM_STATES)
         return utils.FAILURE
     try:
         parameters['StateReason'] = arguments.pop(0)
@@ -101,7 +103,7 @@ def metric_list(options, arguments):
     '''
     List all metric data for a given metric (or all metrics if none specified)
     '''
-    parameters={}
+    parameters = {}
     try:
         parameters['MetricName'] = arguments.pop(0)
     except IndexError:
@@ -127,7 +129,7 @@ e.g
     # specific AlarmName, due to the current engine/db cloudwatch
     # implementation, we should probably revisit this so we can support
     # more generic metric data collection
-    parameters={}
+    parameters = {}
     try:
         parameters['AlarmName'] = arguments.pop(0)
         parameters['Namespace'] = arguments.pop(0)
@@ -188,14 +190,14 @@ def parse_options(parser, cli_args):
 
     if options.debug:
         logging.basicConfig(format='%(levelname)s:%(message)s',
-            level=logging.DEBUG)
+                            level=logging.DEBUG)
         logging.debug("Debug level logging enabled")
     elif options.verbose:
         logging.basicConfig(format='%(levelname)s:%(message)s',
-            level=logging.INFO)
+                            level=logging.INFO)
     else:
         logging.basicConfig(format='%(levelname)s:%(message)s',
-            level=logging.WARNING)
+                            level=logging.WARNING)
 
     return (options, command, args)
 
index f75db12aa80db319e7859e2ccee0e09ef17959f3..9a8a743af83a96fcbe1e2937d07e547dfa5e645a 100755 (executable)
@@ -14,4 +14,4 @@ EXCLUDE+=',*egg,build,*tools*'
 ${PEP8} ${EXCLUDE} .
 
 # Check binaries without py extension
-${PEP8} bin/heat-api bin/heat-api-cfn bin/heat-api-cloudwatch bin/heat-cfn bin/heat-engine
+${PEP8} bin/heat-api bin/heat-api-cfn bin/heat-api-cloudwatch bin/heat-cfn bin/heat-engine bin/heat-watch