summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorEric Day <eday@oddments.org>2010-10-22 21:58:59 +0000
committerTarmac <>2010-10-22 21:58:59 +0000
commite8ffba4d2384b91b154ef1f73df9afd49077386d (patch)
tree35bdf833d47eb09f3ffcd421da9cdadf0064127e /bin
parent685e2a1b4b359c1f7e8ec72817c2c420f2b26a18 (diff)
parent777b14c27ba9bd5ee298f62323b2170023e44ca6 (diff)
downloadnova-e8ffba4d2384b91b154ef1f73df9afd49077386d.tar.gz
nova-e8ffba4d2384b91b154ef1f73df9afd49077386d.tar.xz
nova-e8ffba4d2384b91b154ef1f73df9afd49077386d.zip
Another pep8 cleanup branch for nova/api, should be merged after lp:~eday/nova/pep8-fixes.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nova-api1
-rwxr-xr-xbin/nova-manage47
2 files changed, 25 insertions, 23 deletions
diff --git a/bin/nova-api b/bin/nova-api
index a5027700b..20f1bd74f 100755
--- a/bin/nova-api
+++ b/bin/nova-api
@@ -39,6 +39,7 @@ from nova import server
FLAGS = flags.FLAGS
flags.DEFINE_integer('api_port', 8773, 'API port')
+
def main(_args):
from nova import api
from nova import wsgi
diff --git a/bin/nova-manage b/bin/nova-manage
index 219f32250..08b3da123 100755
--- a/bin/nova-manage
+++ b/bin/nova-manage
@@ -22,8 +22,8 @@
# Copyright (c) 2005, the Lawrence Journal-World
# All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without modification,
-# are permitted provided that the following conditions are met:
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
@@ -32,20 +32,21 @@
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
-# 3. Neither the name of Django nor the names of its contributors may be used
-# to endorse or promote products derived from this software without
+# 3. Neither the name of Django nor the names of its contributors may be
+# used to endorse or promote products derived from this software without
# specific prior written permission.
#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
@@ -181,8 +182,8 @@ class ShellCommands(object):
if shell == 'ipython':
try:
import IPython
- # Explicitly pass an empty list as arguments, because otherwise IPython
- # would use sys.argv from this script.
+ # Explicitly pass an empty list as arguments, because
+ # otherwise IPython would use sys.argv from this script.
shell = IPython.Shell.IPShell(argv=[])
shell.mainloop()
except ImportError:
@@ -190,13 +191,14 @@ class ShellCommands(object):
if shell == 'python':
import code
- try: # Try activating rlcompleter, because it's handy.
+ try:
+ # Try activating rlcompleter, because it's handy.
import readline
except ImportError:
pass
else:
- # We don't have to wrap the following import in a 'try', because
- # we already know 'readline' was imported successfully.
+ # We don't have to wrap the following import in a 'try',
+ # because we already know 'readline' was imported successfully.
import rlcompleter
readline.parse_and_bind("tab:complete")
code.interact()
@@ -242,7 +244,6 @@ class UserCommands(object):
print 'export EC2_ACCESS_KEY=%s' % user.access
print 'export EC2_SECRET_KEY=%s' % user.secret
-
def __init__(self):
self.manager = manager.AuthManager()
@@ -291,6 +292,7 @@ class UserCommands(object):
is_admin = False
self.manager.modify_user(name, access_key, secret_key, is_admin)
+
class ProjectCommands(object):
"""Class for managing projects."""
@@ -380,7 +382,6 @@ class FloatingIpCommands(object):
db.floating_ip_destroy(context.get_admin_context(),
str(address))
-
def list(self, host=None):
"""Lists all floating ips (optionally by host)
arguments: [host]"""
@@ -397,6 +398,7 @@ class FloatingIpCommands(object):
floating_ip['address'],
instance)
+
class NetworkCommands(object):
"""Class for managing networks."""
@@ -429,8 +431,7 @@ CATEGORIES = [
('shell', ShellCommands),
('vpn', VpnCommands),
('floating', FloatingIpCommands),
- ('network', NetworkCommands)
-]
+ ('network', NetworkCommands)]
def lazy_match(name, key_value_tuples):