Skip to content

Commit

Permalink
Add changes introduced by linters
Browse files Browse the repository at this point in the history
This includes all the changes introduced by running `pre-commit run
--all-files`.
  • Loading branch information
larsks committed Jan 14, 2025
1 parent 341f0a5 commit c8ea0d4
Show file tree
Hide file tree
Showing 36 changed files with 5,932 additions and 5,291 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Disable VLAN access to a switchport on a switch.
```
openstack esi switch port disable access
<switch>
<switchport>
<switchport>
```

- `switch`: Switch
Expand Down
10 changes: 5 additions & 5 deletions doc/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Each of these functions has a parser containing data.

### <a name="attach"></a>Attach

The attach command will attack a network to a node.
The attach command will attack a network to a node.

* `openstack esi node network attach <node> --port <port> --network <network>`
* `openstack esi node network attach <node> --port <port> --network <network>`
* Exactly one port or network is needed.
* node: name or UUID of the node.
* port: name or UUID of the port.
Expand All @@ -22,15 +22,15 @@ The attach command will attack a network to a node.

### <a name="detach"></a>Detach

The detach command will detach a network from a node.
The detach command will detach a network from a node.

* `openstack esi node network detach <node> <port>`
* node: name or UUID of the node.
* port: name or UUID of the port.

### <a name="list"></a>List

The list command will list the networks that are attached to a node.
The list command will list the networks that are attached to a node.

* `openstack esi node network list --node <node> --network <network>`
* node: name or UUID of the node.
Expand Down
2 changes: 1 addition & 1 deletion esiclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
import pbr.version


__version__ = pbr.version.VersionInfo('python-esiclient').version_string()
__version__ = pbr.version.VersionInfo("python-esiclient").version_string()
32 changes: 15 additions & 17 deletions esiclient/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@

LOG = logging.getLogger(__name__)

DEFAULT_BAREMETAL_API_VERSION = '1.69'
DEFAULT_ESICLIENT_API_VERSION = '1'
DEFAULT_BAREMETAL_API_VERSION = "1.69"
DEFAULT_ESICLIENT_API_VERSION = "1"

# Required by the OSC plugin interface
API_NAME = 'esiclient'
API_VERSION_OPTION = 'os_esiclient_api_version'
API_VERSIONS = {
'1': 'esiclient.plugin'
}
API_NAME = "esiclient"
API_VERSION_OPTION = "os_esiclient_api_version"
API_VERSIONS = {"1": "esiclient.plugin"}


def make_client(instance):
Expand All @@ -44,21 +42,21 @@ def build_option_parser(parser):
:param argparse.ArgumentParser parser: The parser object that has been
initialized by OpenStackShell.
"""
if ('OS_BAREMETAL_API_VERSION' not in os.environ):
os.environ['OS_BAREMETAL_API_VERSION'] = DEFAULT_BAREMETAL_API_VERSION
if "OS_BAREMETAL_API_VERSION" not in os.environ:
os.environ["OS_BAREMETAL_API_VERSION"] = DEFAULT_BAREMETAL_API_VERSION
parser.add_argument(
'--os-esiclient-api-version',
metavar='<esiclient-api-version>',
"--os-esiclient-api-version",
metavar="<esiclient-api-version>",
default=utils.env(
'OS_ESICLIENT_API_VERSION',
default=DEFAULT_ESICLIENT_API_VERSION),
help='ESI Client API version, default=' +
DEFAULT_ESICLIENT_API_VERSION +
' (Env: OS_ESICLIENT_API_VERSION)')
"OS_ESICLIENT_API_VERSION", default=DEFAULT_ESICLIENT_API_VERSION
),
help="ESI Client API version, default="
+ DEFAULT_ESICLIENT_API_VERSION
+ " (Env: OS_ESICLIENT_API_VERSION)",
)
return parser


class ClientWrapper(object):

def __init__(self, instance):
self._instance = instance
Loading

0 comments on commit c8ea0d4

Please sign in to comment.