Remove list output from "compute service set"

Replace the super class from lister.Lister to command.Command,
as no need to display the status for the "set" command.

Change-Id: Ibaf3c1e349633223fca19937bbd9060d4f9ecbda
Closes-Bug: #1517804
This commit is contained in:
xiexs 2015-12-02 13:45:58 +08:00
parent cb73e781e0
commit fad7126e79
1 changed files with 2 additions and 11 deletions

View File

@ -81,7 +81,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")
@ -113,19 +113,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)