summaryrefslogtreecommitdiff
path: root/openstackclient/compute
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/compute')
-rw-r--r--openstackclient/compute/v2/agent.py1
-rw-r--r--openstackclient/compute/v2/aggregate.py1
-rw-r--r--openstackclient/compute/v2/console.py1
-rw-r--r--openstackclient/compute/v2/fixedip.py2
-rw-r--r--openstackclient/compute/v2/flavor.py1
-rw-r--r--openstackclient/compute/v2/floatingip.py3
-rw-r--r--openstackclient/compute/v2/keypair.py1
-rw-r--r--openstackclient/compute/v2/security_group.py4
-rw-r--r--openstackclient/compute/v2/server.py2
-rw-r--r--openstackclient/compute/v2/service.py16
10 files changed, 4 insertions, 28 deletions
diff --git a/openstackclient/compute/v2/agent.py b/openstackclient/compute/v2/agent.py
index 14c4b2c7..75c67f31 100644
--- a/openstackclient/compute/v2/agent.py
+++ b/openstackclient/compute/v2/agent.py
@@ -91,7 +91,6 @@ class DeleteAgent(command.Command):
self.log.debug("take_action(%s)", parsed_args)
compute_client = self.app.client_manager.compute
compute_client.agents.delete(parsed_args.id)
- return
class ListAgent(lister.Lister):
diff --git a/openstackclient/compute/v2/aggregate.py b/openstackclient/compute/v2/aggregate.py
index a1ba618f..97ad127c 100644
--- a/openstackclient/compute/v2/aggregate.py
+++ b/openstackclient/compute/v2/aggregate.py
@@ -132,7 +132,6 @@ class DeleteAggregate(command.Command):
parsed_args.aggregate,
)
compute_client.aggregates.delete(data.id)
- return
class ListAggregate(lister.Lister):
diff --git a/openstackclient/compute/v2/console.py b/openstackclient/compute/v2/console.py
index aafa5d44..f0864786 100644
--- a/openstackclient/compute/v2/console.py
+++ b/openstackclient/compute/v2/console.py
@@ -65,7 +65,6 @@ class ShowConsoleLog(command.Command):
data = server.get_console_output(length=length)
sys.stdout.write(data)
- return
class ShowConsoleURL(show.ShowOne):
diff --git a/openstackclient/compute/v2/fixedip.py b/openstackclient/compute/v2/fixedip.py
index da9d85c3..1ab8a18c 100644
--- a/openstackclient/compute/v2/fixedip.py
+++ b/openstackclient/compute/v2/fixedip.py
@@ -52,7 +52,6 @@ class AddFixedIP(command.Command):
compute_client.servers, parsed_args.server)
server.add_fixed_ip(network.id)
- return
class RemoveFixedIP(command.Command):
@@ -82,4 +81,3 @@ class RemoveFixedIP(command.Command):
compute_client.servers, parsed_args.server)
server.remove_fixed_ip(parsed_args.ip_address)
- return
diff --git a/openstackclient/compute/v2/flavor.py b/openstackclient/compute/v2/flavor.py
index 7474580b..b34197e0 100644
--- a/openstackclient/compute/v2/flavor.py
+++ b/openstackclient/compute/v2/flavor.py
@@ -145,7 +145,6 @@ class DeleteFlavor(command.Command):
flavor = utils.find_resource(compute_client.flavors,
parsed_args.flavor)
compute_client.flavors.delete(flavor.id)
- return
class ListFlavor(lister.Lister):
diff --git a/openstackclient/compute/v2/floatingip.py b/openstackclient/compute/v2/floatingip.py
index 65fe5910..6f2e360c 100644
--- a/openstackclient/compute/v2/floatingip.py
+++ b/openstackclient/compute/v2/floatingip.py
@@ -52,7 +52,6 @@ class AddFloatingIP(command.Command):
compute_client.servers, parsed_args.server)
server.add_floating_ip(parsed_args.ip_address)
- return
class CreateFloatingIP(show.ShowOne):
@@ -103,7 +102,6 @@ class DeleteFloatingIP(command.Command):
)
compute_client.floating_ips.delete(floating_ip)
- return
class ListFloatingIP(lister.Lister):
@@ -153,4 +151,3 @@ class RemoveFloatingIP(command.Command):
compute_client.servers, parsed_args.server)
server.remove_floating_ip(parsed_args.ip_address)
- return
diff --git a/openstackclient/compute/v2/keypair.py b/openstackclient/compute/v2/keypair.py
index 5c627c50..96562985 100644
--- a/openstackclient/compute/v2/keypair.py
+++ b/openstackclient/compute/v2/keypair.py
@@ -97,7 +97,6 @@ class DeleteKeypair(command.Command):
def take_action(self, parsed_args):
compute_client = self.app.client_manager.compute
compute_client.keypairs.delete(parsed_args.name)
- return
class ListKeypair(lister.Lister):
diff --git a/openstackclient/compute/v2/security_group.py b/openstackclient/compute/v2/security_group.py
index 42581d55..95e3a1c1 100644
--- a/openstackclient/compute/v2/security_group.py
+++ b/openstackclient/compute/v2/security_group.py
@@ -187,7 +187,6 @@ class DeleteSecurityGroup(command.Command):
parsed_args.group,
)
compute_client.security_groups.delete(data.id)
- return
class DeleteSecurityGroupRule(command.Command):
@@ -209,7 +208,6 @@ class DeleteSecurityGroupRule(command.Command):
compute_client = self.app.client_manager.compute
compute_client.security_group_rules.delete(parsed_args.rule)
- return
class ListSecurityGroup(lister.Lister):
@@ -402,7 +400,7 @@ class ShowSecurityGroup(show.ShowOne):
# Format rules into a list of strings
info.update(
- {'rules': rules}
+ {'rules': utils.format_list(rules, separator='\n')}
)
# Map 'tenant_id' column to 'project_id'
info.update(
diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py
index 9e2721fb..be0ad8cb 100644
--- a/openstackclient/compute/v2/server.py
+++ b/openstackclient/compute/v2/server.py
@@ -204,7 +204,6 @@ class AddServerSecurityGroup(command.Command):
)
server.add_security_group(security_group.name)
- return
class AddServerVolume(command.Command):
@@ -665,7 +664,6 @@ class DeleteServer(command.Command):
server_obj.id)
sys.stdout.write(_('\nError deleting server'))
raise SystemExit
- return
class ListServer(lister.Lister):
diff --git a/openstackclient/compute/v2/service.py b/openstackclient/compute/v2/service.py
index c2d51c2a..af3e940a 100644
--- a/openstackclient/compute/v2/service.py
+++ b/openstackclient/compute/v2/service.py
@@ -41,7 +41,6 @@ class DeleteService(command.Command):
compute_client = self.app.client_manager.compute
compute_client.services.delete(parsed_args.service)
- return
class ListService(lister.Lister):
@@ -81,7 +80,7 @@ class ListService(lister.Lister):
) for s in data))
-class SetService(lister.Lister):
+class SetService(command.Command):
"""Set service command"""
log = logging.getLogger(__name__ + ".SetService")
@@ -101,7 +100,7 @@ class SetService(lister.Lister):
"--enable",
dest="enabled",
default=True,
- help="Enable a service",
+ help="Enable a service (default)",
action="store_true")
enabled_group.add_argument(
"--disable",
@@ -113,19 +112,10 @@ class SetService(lister.Lister):
def take_action(self, parsed_args):
self.log.debug("take_action(%s)", parsed_args)
compute_client = self.app.client_manager.compute
- columns = (
- "Host",
- "Service",
- "Disabled"
- )
if parsed_args.enabled:
action = compute_client.services.enable
else:
action = compute_client.services.disable
- data = action(parsed_args.host, parsed_args.service)
- return (columns,
- (utils.get_item_properties(
- s, columns,
- ) for s in data))
+ action(parsed_args.host, parsed_args.service)