Use osc_lib instead of cliff
Base classes of commands are defined in cliff, but have been encapsulated again in osc-lib for all plugin clients. So use osc-lib instead of cliff. Change-Id: I615bd541418df04970c44dee448ac61fae462443
This commit is contained in:
		| @@ -17,8 +17,7 @@ | ||||
| import json | ||||
| import logging | ||||
|  | ||||
| from cliff import command | ||||
| from cliff import show | ||||
| from osc_lib.command import command | ||||
|  | ||||
| from mistralclient.commands.v2 import base | ||||
| from mistralclient import utils | ||||
| @@ -60,7 +59,7 @@ def format(action_ex=None, lister=False): | ||||
|     return columns, data | ||||
|  | ||||
|  | ||||
| class Create(show.ShowOne): | ||||
| class Create(command.ShowOne): | ||||
|     """Create new Action execution or just run specific action.""" | ||||
|  | ||||
|     def produce_output(self, parsed_args, column_names, data): | ||||
| @@ -156,7 +155,7 @@ class List(base.MistralLister): | ||||
|         ) | ||||
|  | ||||
|  | ||||
| class Get(show.ShowOne): | ||||
| class Get(command.ShowOne): | ||||
|     """Show specific Action execution.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
| @@ -174,7 +173,7 @@ class Get(show.ShowOne): | ||||
|         return format(execution) | ||||
|  | ||||
|  | ||||
| class Update(show.ShowOne): | ||||
| class Update(command.ShowOne): | ||||
|     """Update specific Action execution.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
|   | ||||
| @@ -17,8 +17,7 @@ | ||||
| import argparse | ||||
| import logging | ||||
|  | ||||
| from cliff import command | ||||
| from cliff import show | ||||
| from osc_lib.command import command | ||||
|  | ||||
| from mistralclient.commands.v2 import base | ||||
| from mistralclient import utils | ||||
| @@ -78,7 +77,7 @@ class List(base.MistralLister): | ||||
|         return mistral_client.actions.list() | ||||
|  | ||||
|  | ||||
| class Get(show.ShowOne): | ||||
| class Get(command.ShowOne): | ||||
|     """Show specific action.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
| @@ -203,7 +202,7 @@ class GetDefinition(command.Command): | ||||
|         self.app.stdout.write(definition or "\n") | ||||
|  | ||||
|  | ||||
| class Validate(show.ShowOne): | ||||
| class Validate(command.ShowOne): | ||||
|     """Validate action.""" | ||||
|  | ||||
|     def _format(self, result=None): | ||||
|   | ||||
| @@ -17,12 +17,12 @@ | ||||
| import abc | ||||
| import textwrap | ||||
|  | ||||
| from cliff import lister | ||||
| from osc_lib.command import command | ||||
| import six | ||||
|  | ||||
|  | ||||
| @six.add_metaclass(abc.ABCMeta) | ||||
| class MistralLister(lister.Lister): | ||||
| class MistralLister(command.Lister): | ||||
|     @abc.abstractmethod | ||||
|     def _get_format_function(self): | ||||
|         raise NotImplementedError | ||||
|   | ||||
| @@ -17,8 +17,7 @@ | ||||
| import json | ||||
| import logging | ||||
|  | ||||
| from cliff import command | ||||
| from cliff import show | ||||
| from osc_lib.command import command | ||||
|  | ||||
| from mistralclient.commands.v2 import base | ||||
| from mistralclient import utils | ||||
| @@ -82,7 +81,7 @@ class List(base.MistralLister): | ||||
|         return mistral_client.cron_triggers.list() | ||||
|  | ||||
|  | ||||
| class Get(show.ShowOne): | ||||
| class Get(command.ShowOne): | ||||
|     """Show specific cron trigger.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
| @@ -98,7 +97,7 @@ class Get(show.ShowOne): | ||||
|         return format(mistral_client.cron_triggers.get(parsed_args.name)) | ||||
|  | ||||
|  | ||||
| class Create(show.ShowOne): | ||||
| class Create(command.ShowOne): | ||||
|     """Create new trigger.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
|   | ||||
| @@ -16,8 +16,7 @@ import argparse | ||||
| import json | ||||
| import logging | ||||
|  | ||||
| from cliff import command | ||||
| from cliff import show | ||||
| from osc_lib.command import command | ||||
|  | ||||
| from mistralclient.commands.v2 import base | ||||
| from mistralclient import utils | ||||
| @@ -99,7 +98,7 @@ class List(base.MistralLister): | ||||
|         return mistral_client.environments.list() | ||||
|  | ||||
|  | ||||
| class Get(show.ShowOne): | ||||
| class Get(command.ShowOne): | ||||
|     """Show specific environment.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
| @@ -119,7 +118,7 @@ class Get(show.ShowOne): | ||||
|         return format(environment) | ||||
|  | ||||
|  | ||||
| class Create(show.ShowOne): | ||||
| class Create(command.ShowOne): | ||||
|     """Create new environment.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
| @@ -163,7 +162,7 @@ class Delete(command.Command): | ||||
|         ) | ||||
|  | ||||
|  | ||||
| class Update(show.ShowOne): | ||||
| class Update(command.ShowOne): | ||||
|     """Update environment.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
|   | ||||
| @@ -19,8 +19,7 @@ import json | ||||
| import logging | ||||
| import os.path | ||||
|  | ||||
| from cliff import command | ||||
| from cliff import show | ||||
| from osc_lib.command import command | ||||
|  | ||||
| from mistralclient.commands.v2 import base | ||||
| from mistralclient import utils | ||||
| @@ -119,7 +118,7 @@ class List(base.MistralLister): | ||||
|         ) | ||||
|  | ||||
|  | ||||
| class Get(show.ShowOne): | ||||
| class Get(command.ShowOne): | ||||
|     """Show specific execution.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
| @@ -136,7 +135,7 @@ class Get(show.ShowOne): | ||||
|         return format(execution) | ||||
|  | ||||
|  | ||||
| class Create(show.ShowOne): | ||||
| class Create(command.ShowOne): | ||||
|     """Create new execution.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
| @@ -221,7 +220,7 @@ class Delete(command.Command): | ||||
|         ) | ||||
|  | ||||
|  | ||||
| class Update(show.ShowOne): | ||||
| class Update(command.ShowOne): | ||||
|     """Update execution.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
|   | ||||
| @@ -13,8 +13,7 @@ | ||||
| #    under the License. | ||||
| # | ||||
|  | ||||
| from cliff import command | ||||
| from cliff import show | ||||
| from osc_lib.command import command | ||||
|  | ||||
| from mistralclient.commands.v2 import base | ||||
| from mistralclient import exceptions | ||||
| @@ -83,7 +82,7 @@ class List(base.MistralLister): | ||||
|         ) | ||||
|  | ||||
|  | ||||
| class Get(show.ShowOne): | ||||
| class Get(command.ShowOne): | ||||
|     """Show specific member information.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
| @@ -118,7 +117,7 @@ class Get(show.ShowOne): | ||||
|         return format(member) | ||||
|  | ||||
|  | ||||
| class Create(show.ShowOne): | ||||
| class Create(command.ShowOne): | ||||
|     """Shares a resource to another tenant.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
| @@ -192,7 +191,7 @@ class Delete(command.Command): | ||||
|             raise exceptions.MistralClientException(error_msg) | ||||
|  | ||||
|  | ||||
| class Update(show.ShowOne): | ||||
| class Update(command.ShowOne): | ||||
|     """Update resource sharing status.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
|   | ||||
| @@ -19,8 +19,7 @@ import json | ||||
| import logging | ||||
| import os.path | ||||
|  | ||||
| from cliff import command | ||||
| from cliff import show | ||||
| from osc_lib.command import command | ||||
|  | ||||
| from mistralclient.commands.v2 import base | ||||
| from mistralclient import utils | ||||
| @@ -80,7 +79,7 @@ class List(base.MistralLister): | ||||
|         return mistral_client.tasks.list(parsed_args.workflow_execution) | ||||
|  | ||||
|  | ||||
| class Get(show.ShowOne): | ||||
| class Get(command.ShowOne): | ||||
|     """Show specific task.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
| @@ -145,7 +144,7 @@ class GetPublished(command.Command): | ||||
|         self.app.stdout.write(result or "\n") | ||||
|  | ||||
|  | ||||
| class Rerun(show.ShowOne): | ||||
| class Rerun(command.ShowOne): | ||||
|     """Rerun an existing task.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
|   | ||||
| @@ -16,8 +16,7 @@ | ||||
| import argparse | ||||
| import logging | ||||
|  | ||||
| from cliff import command | ||||
| from cliff import show | ||||
| from osc_lib.command import command | ||||
|  | ||||
| from mistralclient.commands.v2 import base | ||||
| from mistralclient import utils | ||||
| @@ -63,7 +62,7 @@ class List(base.MistralLister): | ||||
|         return mistral_client.workbooks.list() | ||||
|  | ||||
|  | ||||
| class Get(show.ShowOne): | ||||
| class Get(command.ShowOne): | ||||
|     """Show specific workbook.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
| @@ -83,7 +82,7 @@ class Get(show.ShowOne): | ||||
|         return format(workbook) | ||||
|  | ||||
|  | ||||
| class Create(show.ShowOne): | ||||
| class Create(command.ShowOne): | ||||
|     """Create new workbook.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
| @@ -126,7 +125,7 @@ class Delete(command.Command): | ||||
|         ) | ||||
|  | ||||
|  | ||||
| class Update(show.ShowOne): | ||||
| class Update(command.ShowOne): | ||||
|     """Update workbook.""" | ||||
|  | ||||
|     def get_parser(self, prog_name): | ||||
| @@ -166,7 +165,7 @@ class GetDefinition(command.Command): | ||||
|         self.app.stdout.write(definition or "\n") | ||||
|  | ||||
|  | ||||
| class Validate(show.ShowOne): | ||||
| class Validate(command.ShowOne): | ||||
|     """Validate workbook.""" | ||||
|  | ||||
|     def _format(self, result=None): | ||||
|   | ||||
| @@ -33,8 +33,8 @@ import mistralclient.commands.v2.workflows | ||||
| from mistralclient.openstack.common import cliutils as c | ||||
|  | ||||
| from cliff import app | ||||
| from cliff import command | ||||
| from cliff import commandmanager | ||||
| from osc_lib.command import command | ||||
|  | ||||
| import argparse | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Tang Chen
					Tang Chen