From 0a0e15141fd01c20e586049c5754113c7daf8f1b Mon Sep 17 00:00:00 2001 From: Tang Chen Date: Tue, 28 Jun 2016 15:00:49 +0800 Subject: [PATCH] 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. Since osc-lib 1.0.2 has released, it is stable to use. Change-Id: I0b9bf1c867be0181d573decadc840a887a784ca9 --- ironicclient/osc/v1/baremetal_node.py | 10 ++++------ ironicclient/osc/v1/baremetal_port.py | 7 +++---- releasenotes/notes/osc-lib-090d62f647b9d58b.yaml | 4 ++++ requirements.txt | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 releasenotes/notes/osc-lib-090d62f647b9d58b.yaml diff --git a/ironicclient/osc/v1/baremetal_node.py b/ironicclient/osc/v1/baremetal_node.py index 1906df283..96c1079c5 100644 --- a/ironicclient/osc/v1/baremetal_node.py +++ b/ironicclient/osc/v1/baremetal_node.py @@ -18,10 +18,8 @@ import argparse import itertools import logging -from cliff import command -from cliff import lister -from cliff import show from openstackclient.common import utils as oscutils +from osc_lib.command import command from ironicclient.common.i18n import _ from ironicclient.common import utils @@ -105,7 +103,7 @@ class CleanBaremetalNode(ProvisionStateBaremetalNode): cleansteps=clean_steps) -class CreateBaremetalNode(show.ShowOne): +class CreateBaremetalNode(command.ShowOne): """Register a new node with the baremetal service""" log = logging.getLogger(__name__ + ".CreateBaremetalNode") @@ -265,7 +263,7 @@ class InspectBaremetalNode(ProvisionStateBaremetalNode): PROVISION_STATE = 'inspect' -class ListBaremetalNode(lister.Lister): +class ListBaremetalNode(command.Lister): """List baremetal nodes""" log = logging.getLogger(__name__ + ".ListBaremetalNode") @@ -656,7 +654,7 @@ class SetBaremetal(SetBaremetalNode): return super(SetBaremetal, self).take_action(parsed_args) -class ShowBaremetalNode(show.ShowOne): +class ShowBaremetalNode(command.ShowOne): """Show baremetal node details""" log = logging.getLogger(__name__ + ".ShowBaremetalNode") diff --git a/ironicclient/osc/v1/baremetal_port.py b/ironicclient/osc/v1/baremetal_port.py index 7340032b4..30315e528 100644 --- a/ironicclient/osc/v1/baremetal_port.py +++ b/ironicclient/osc/v1/baremetal_port.py @@ -17,14 +17,13 @@ import itertools import logging -from cliff import command -from cliff import show +from osc_lib.command import command from ironicclient.common import utils from ironicclient.v1 import resource_fields as res_fields -class CreateBaremetalPort(show.ShowOne): +class CreateBaremetalPort(command.ShowOne): """Create a new port""" log = logging.getLogger(__name__ + ".CreateBaremetalPort") @@ -104,7 +103,7 @@ class CreateBaremetalPort(show.ShowOne): return self.dict2columns(data) -class ShowBaremetalPort(show.ShowOne): +class ShowBaremetalPort(command.ShowOne): """Show baremetal port details.""" log = logging.getLogger(__name__ + ".ShowBaremetalPort") diff --git a/releasenotes/notes/osc-lib-090d62f647b9d58b.yaml b/releasenotes/notes/osc-lib-090d62f647b9d58b.yaml new file mode 100644 index 000000000..3e94528d1 --- /dev/null +++ b/releasenotes/notes/osc-lib-090d62f647b9d58b.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - osc-lib is a package of common support modules for writing OSC plugins. + So use osc-lib instead of cliff. diff --git a/requirements.txt b/requirements.txt index e0762f364..f78212d1b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,9 +4,9 @@ pbr>=1.6 # Apache-2.0 appdirs>=1.3.0 # MIT License dogpile.cache>=0.6.1 # BSD -cliff!=1.16.0,!=1.17.0,>=1.15.0 # Apache-2.0 jsonschema!=2.5.0,<3.0.0,>=2.0.0 # MIT keystoneauth1>=2.10.0 # Apache-2.0 +osc-lib>=1.0.2 # Apache-2.0 oslo.i18n>=2.1.0 # Apache-2.0 oslo.utils>=3.16.0 # Apache-2.0 PrettyTable<0.8,>=0.7 # BSD