diff --git a/SoftLayer/CLI/call_api.py b/SoftLayer/CLI/call_api.py index 86c66f0bc..11afe6839 100644 --- a/SoftLayer/CLI/call_api.py +++ b/SoftLayer/CLI/call_api.py @@ -1,9 +1,8 @@ """Call arbitrary API endpoints.""" +import json import click -import json - from SoftLayer.CLI import environment from SoftLayer.CLI import formatting diff --git a/SoftLayer/CLI/cdn/detail.py b/SoftLayer/CLI/cdn/detail.py index de74e913c..45e5c2218 100644 --- a/SoftLayer/CLI/cdn/detail.py +++ b/SoftLayer/CLI/cdn/detail.py @@ -1,12 +1,12 @@ """Detail a CDN Account.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @click.argument('account_id') diff --git a/SoftLayer/CLI/cdn/list.py b/SoftLayer/CLI/cdn/list.py index 71deb4db2..2e1b07785 100644 --- a/SoftLayer/CLI/cdn/list.py +++ b/SoftLayer/CLI/cdn/list.py @@ -1,12 +1,12 @@ """List CDN Accounts.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @click.option('--sortby', diff --git a/SoftLayer/CLI/cdn/load.py b/SoftLayer/CLI/cdn/load.py index 5dc53ca2b..648f4f34e 100644 --- a/SoftLayer/CLI/cdn/load.py +++ b/SoftLayer/CLI/cdn/load.py @@ -1,11 +1,11 @@ """Cache one or more files on all edge nodes.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment -import click - @click.command() @click.argument('account_id') diff --git a/SoftLayer/CLI/cdn/origin_add.py b/SoftLayer/CLI/cdn/origin_add.py index c8f5635b5..aa233ecd6 100644 --- a/SoftLayer/CLI/cdn/origin_add.py +++ b/SoftLayer/CLI/cdn/origin_add.py @@ -1,10 +1,11 @@ """Create an origin pull mapping.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment -import click # pylint: disable=redefined-builtin diff --git a/SoftLayer/CLI/cdn/origin_list.py b/SoftLayer/CLI/cdn/origin_list.py index 613dfb35f..1867a9cdd 100644 --- a/SoftLayer/CLI/cdn/origin_list.py +++ b/SoftLayer/CLI/cdn/origin_list.py @@ -1,12 +1,12 @@ """List origin pull mappings.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @click.argument('account_id') diff --git a/SoftLayer/CLI/cdn/origin_remove.py b/SoftLayer/CLI/cdn/origin_remove.py index 055a93bb2..2b8855ede 100644 --- a/SoftLayer/CLI/cdn/origin_remove.py +++ b/SoftLayer/CLI/cdn/origin_remove.py @@ -1,11 +1,11 @@ """Remove an origin pull mapping.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment -import click - @click.command() @click.argument('account_id') diff --git a/SoftLayer/CLI/cdn/purge.py b/SoftLayer/CLI/cdn/purge.py index 09d0810ae..7738600a3 100644 --- a/SoftLayer/CLI/cdn/purge.py +++ b/SoftLayer/CLI/cdn/purge.py @@ -1,11 +1,11 @@ """Purge cached files from all edge nodes.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment -import click - @click.command() @click.argument('account_id') diff --git a/SoftLayer/CLI/config/setup.py b/SoftLayer/CLI/config/setup.py index 2a16787f9..de3399ace 100644 --- a/SoftLayer/CLI/config/setup.py +++ b/SoftLayer/CLI/config/setup.py @@ -2,6 +2,8 @@ # :license: MIT, see LICENSE for more details. import os.path +import click + import SoftLayer from SoftLayer import auth from SoftLayer.CLI import config @@ -10,8 +12,6 @@ from SoftLayer.CLI import formatting from SoftLayer import utils -import click - def get_api_key(client, username, secret): """Attempts API-Key and password auth to get an API key. diff --git a/SoftLayer/CLI/config/show.py b/SoftLayer/CLI/config/show.py index 5ddd6ca7d..0e195c450 100644 --- a/SoftLayer/CLI/config/show.py +++ b/SoftLayer/CLI/config/show.py @@ -1,11 +1,11 @@ """Show current CLI configuration.""" # :license: MIT, see LICENSE for more details. +import click + from SoftLayer.CLI import config from SoftLayer.CLI import environment -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/core.py b/SoftLayer/CLI/core.py index 364623548..d92b19d66 100644 --- a/SoftLayer/CLI/core.py +++ b/SoftLayer/CLI/core.py @@ -10,12 +10,13 @@ import sys import types +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting -import click # pylint: disable=too-many-public-methods, broad-except, unused-argument # pylint: disable=redefined-builtin, super-init-not-called diff --git a/SoftLayer/CLI/dns/record_add.py b/SoftLayer/CLI/dns/record_add.py index 856c4be53..79a04fec4 100644 --- a/SoftLayer/CLI/dns/record_add.py +++ b/SoftLayer/CLI/dns/record_add.py @@ -1,11 +1,11 @@ """Add resource record.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers - -import click # pylint: disable=redefined-builtin diff --git a/SoftLayer/CLI/dns/record_edit.py b/SoftLayer/CLI/dns/record_edit.py index e5394e37b..13284c91b 100644 --- a/SoftLayer/CLI/dns/record_edit.py +++ b/SoftLayer/CLI/dns/record_edit.py @@ -1,11 +1,11 @@ """Update DNS record.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers - -import click # pylint: disable=redefined-builtin diff --git a/SoftLayer/CLI/dns/record_list.py b/SoftLayer/CLI/dns/record_list.py index 26bb668d8..bea709819 100644 --- a/SoftLayer/CLI/dns/record_list.py +++ b/SoftLayer/CLI/dns/record_list.py @@ -1,12 +1,12 @@ """List all records in a zone.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers - -import click # pylint: disable=redefined-builtin diff --git a/SoftLayer/CLI/dns/record_remove.py b/SoftLayer/CLI/dns/record_remove.py index 6e73790ce..3319eadcb 100644 --- a/SoftLayer/CLI/dns/record_remove.py +++ b/SoftLayer/CLI/dns/record_remove.py @@ -1,13 +1,13 @@ """Remove resource record.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting -import click - @click.command() @click.argument('record_id') diff --git a/SoftLayer/CLI/dns/zone_create.py b/SoftLayer/CLI/dns/zone_create.py index 21b9e9289..8618404d3 100644 --- a/SoftLayer/CLI/dns/zone_create.py +++ b/SoftLayer/CLI/dns/zone_create.py @@ -1,11 +1,11 @@ """Create a zone.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment -import click - @click.command() @click.argument('zone') diff --git a/SoftLayer/CLI/dns/zone_delete.py b/SoftLayer/CLI/dns/zone_delete.py index 3027bbed4..b0104a9cc 100644 --- a/SoftLayer/CLI/dns/zone_delete.py +++ b/SoftLayer/CLI/dns/zone_delete.py @@ -1,14 +1,14 @@ """Delete zone.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('zone') diff --git a/SoftLayer/CLI/dns/zone_import.py b/SoftLayer/CLI/dns/zone_import.py index 505dab7d0..6e1259de0 100644 --- a/SoftLayer/CLI/dns/zone_import.py +++ b/SoftLayer/CLI/dns/zone_import.py @@ -2,13 +2,13 @@ # :license: MIT, see LICENSE for more details. import re +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import helpers -import click - RECORD_REGEX = re.compile(r"""^((?P([\w-]+(\.)?)*|\@)?\s+ (?P\d+)?\s+ (?P\w+)?)?\s+ diff --git a/SoftLayer/CLI/dns/zone_list.py b/SoftLayer/CLI/dns/zone_list.py index a8558b7d7..f555677c7 100644 --- a/SoftLayer/CLI/dns/zone_list.py +++ b/SoftLayer/CLI/dns/zone_list.py @@ -1,12 +1,12 @@ """List all zones.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/dns/zone_print.py b/SoftLayer/CLI/dns/zone_print.py index 8c1901f32..bdb237409 100644 --- a/SoftLayer/CLI/dns/zone_print.py +++ b/SoftLayer/CLI/dns/zone_print.py @@ -1,12 +1,12 @@ """Print zone in BIND format.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('zone') diff --git a/SoftLayer/CLI/environment.py b/SoftLayer/CLI/environment.py index 12657d0d5..70950ed8d 100644 --- a/SoftLayer/CLI/environment.py +++ b/SoftLayer/CLI/environment.py @@ -7,12 +7,12 @@ """ import importlib -from SoftLayer.CLI import formatting -from SoftLayer.CLI import routes - import click import pkg_resources +from SoftLayer.CLI import formatting +from SoftLayer.CLI import routes + # pylint: disable=too-many-instance-attributes, invalid-name, no-self-use # Calling pkg_resources.iter_entry_points shows a false-positive diff --git a/SoftLayer/CLI/firewall/add.py b/SoftLayer/CLI/firewall/add.py index 4088e827c..5eba9b778 100644 --- a/SoftLayer/CLI/firewall/add.py +++ b/SoftLayer/CLI/firewall/add.py @@ -1,13 +1,13 @@ """Create new firewall.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting -import click - @click.command() @click.argument('target') diff --git a/SoftLayer/CLI/firewall/cancel.py b/SoftLayer/CLI/firewall/cancel.py index 8a9fe8de7..a654a55ed 100644 --- a/SoftLayer/CLI/firewall/cancel.py +++ b/SoftLayer/CLI/firewall/cancel.py @@ -1,14 +1,14 @@ """Cancels a firewall.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import firewall from SoftLayer.CLI import formatting -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/firewall/detail.py b/SoftLayer/CLI/firewall/detail.py index 98ffab8dc..06c2c790b 100644 --- a/SoftLayer/CLI/firewall/detail.py +++ b/SoftLayer/CLI/firewall/detail.py @@ -1,13 +1,13 @@ """Detail firewall.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import firewall from SoftLayer.CLI import formatting -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/firewall/edit.py b/SoftLayer/CLI/firewall/edit.py index 5586cc12f..c41e696a1 100644 --- a/SoftLayer/CLI/firewall/edit.py +++ b/SoftLayer/CLI/firewall/edit.py @@ -5,14 +5,14 @@ import subprocess import tempfile +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import firewall from SoftLayer.CLI import formatting -import click - DELIMITER = "=========================================\n" diff --git a/SoftLayer/CLI/firewall/list.py b/SoftLayer/CLI/firewall/list.py index ff8f7c8e6..c16ea2e06 100644 --- a/SoftLayer/CLI/firewall/list.py +++ b/SoftLayer/CLI/firewall/list.py @@ -1,13 +1,13 @@ """List firewalls.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer import utils -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/formatting.py b/SoftLayer/CLI/formatting.py index 2c4776dd5..51083e3c7 100644 --- a/SoftLayer/CLI/formatting.py +++ b/SoftLayer/CLI/formatting.py @@ -349,7 +349,7 @@ def __le__(self, other): return self < other or self == other def __ge__(self, other): - return not self < other + return self >= other def _format_python_value(value): diff --git a/SoftLayer/CLI/globalip/assign.py b/SoftLayer/CLI/globalip/assign.py index ba13739af..ea9a3d12f 100644 --- a/SoftLayer/CLI/globalip/assign.py +++ b/SoftLayer/CLI/globalip/assign.py @@ -1,12 +1,12 @@ """Assigns the global IP to a target.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/globalip/cancel.py b/SoftLayer/CLI/globalip/cancel.py index 7d0252d2e..1f632638d 100644 --- a/SoftLayer/CLI/globalip/cancel.py +++ b/SoftLayer/CLI/globalip/cancel.py @@ -1,14 +1,14 @@ """Cancel global IP.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/globalip/create.py b/SoftLayer/CLI/globalip/create.py index 257f7a6fc..2aee49919 100644 --- a/SoftLayer/CLI/globalip/create.py +++ b/SoftLayer/CLI/globalip/create.py @@ -1,13 +1,13 @@ """Creates a global IP.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting -import click - @click.command() @click.option('--ipv6', '--v6', is_flag=True, help='Order a IPv6 IP') diff --git a/SoftLayer/CLI/globalip/list.py b/SoftLayer/CLI/globalip/list.py index 207bfae12..ec1b6d846 100644 --- a/SoftLayer/CLI/globalip/list.py +++ b/SoftLayer/CLI/globalip/list.py @@ -1,12 +1,12 @@ """List all global IPs.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @click.option('--ip-version', diff --git a/SoftLayer/CLI/globalip/unassign.py b/SoftLayer/CLI/globalip/unassign.py index e7c0d9f7e..b6ff606ed 100644 --- a/SoftLayer/CLI/globalip/unassign.py +++ b/SoftLayer/CLI/globalip/unassign.py @@ -1,12 +1,12 @@ """Unassigns a global IP from a target.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/helpers.py b/SoftLayer/CLI/helpers.py index 7ee189592..f32595e59 100644 --- a/SoftLayer/CLI/helpers.py +++ b/SoftLayer/CLI/helpers.py @@ -6,10 +6,10 @@ :license: MIT, see LICENSE for more details. """ -from SoftLayer.CLI import exceptions - import click +from SoftLayer.CLI import exceptions + def multi_option(*param_decls, **attrs): """modify help text and indicate option is permitted multiple times diff --git a/SoftLayer/CLI/image/delete.py b/SoftLayer/CLI/image/delete.py index 6cfc903b7..36b1abc7c 100644 --- a/SoftLayer/CLI/image/delete.py +++ b/SoftLayer/CLI/image/delete.py @@ -1,12 +1,12 @@ """Delete an image.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/image/detail.py b/SoftLayer/CLI/image/detail.py index b3129ee90..cd2e2d8ca 100644 --- a/SoftLayer/CLI/image/detail.py +++ b/SoftLayer/CLI/image/detail.py @@ -1,6 +1,8 @@ """Get details for an image.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting @@ -8,8 +10,6 @@ from SoftLayer.CLI import image as image_mod from SoftLayer import utils -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/image/edit.py b/SoftLayer/CLI/image/edit.py index 4f4d68892..9df40b18a 100644 --- a/SoftLayer/CLI/image/edit.py +++ b/SoftLayer/CLI/image/edit.py @@ -1,13 +1,13 @@ """Edit details of an image.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/image/export.py b/SoftLayer/CLI/image/export.py index 15d23e055..327cef475 100644 --- a/SoftLayer/CLI/image/export.py +++ b/SoftLayer/CLI/image/export.py @@ -1,15 +1,14 @@ """Export an image.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import helpers -import click - - @click.command() @click.argument('identifier') @click.argument('uri') diff --git a/SoftLayer/CLI/image/import.py b/SoftLayer/CLI/image/import.py index 1bb06526e..7416bb705 100644 --- a/SoftLayer/CLI/image/import.py +++ b/SoftLayer/CLI/image/import.py @@ -1,15 +1,14 @@ """Import an image.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting -import click - - @click.command() @click.argument('name') @click.argument('uri') diff --git a/SoftLayer/CLI/image/list.py b/SoftLayer/CLI/image/list.py index 50b111112..fd45932c4 100644 --- a/SoftLayer/CLI/image/list.py +++ b/SoftLayer/CLI/image/list.py @@ -1,14 +1,14 @@ """List images.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import image as image_mod from SoftLayer import utils -import click - @click.command() @click.option('--name', default=None, help='Filter on image name') diff --git a/SoftLayer/CLI/iscsi/cancel.py b/SoftLayer/CLI/iscsi/cancel.py index ff9980c30..f744cb627 100644 --- a/SoftLayer/CLI/iscsi/cancel.py +++ b/SoftLayer/CLI/iscsi/cancel.py @@ -1,14 +1,14 @@ """Cancel an existing iSCSI account.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/iscsi/create.py b/SoftLayer/CLI/iscsi/create.py index 0a8a480d4..95872c79a 100644 --- a/SoftLayer/CLI/iscsi/create.py +++ b/SoftLayer/CLI/iscsi/create.py @@ -1,11 +1,11 @@ """Creates an iSCSI target.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment -import click - @click.command() @click.option('--size', diff --git a/SoftLayer/CLI/iscsi/detail.py b/SoftLayer/CLI/iscsi/detail.py index f05e49b34..22cd0da8c 100644 --- a/SoftLayer/CLI/iscsi/detail.py +++ b/SoftLayer/CLI/iscsi/detail.py @@ -1,14 +1,14 @@ """Get details for an iSCSI target.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers from SoftLayer import utils -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/iscsi/list.py b/SoftLayer/CLI/iscsi/list.py index e1d6e6afa..4dcb1508e 100644 --- a/SoftLayer/CLI/iscsi/list.py +++ b/SoftLayer/CLI/iscsi/list.py @@ -1,13 +1,13 @@ """List iSCSI targets.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer import utils -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/loadbal/cancel.py b/SoftLayer/CLI/loadbal/cancel.py index 6419a0626..68e3e62ca 100644 --- a/SoftLayer/CLI/loadbal/cancel.py +++ b/SoftLayer/CLI/loadbal/cancel.py @@ -1,14 +1,14 @@ """Cancel an existing load balancer.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import loadbal -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/loadbal/create.py b/SoftLayer/CLI/loadbal/create.py index 0c3703488..e32cc6297 100644 --- a/SoftLayer/CLI/loadbal/create.py +++ b/SoftLayer/CLI/loadbal/create.py @@ -1,13 +1,13 @@ """Adds a load balancer given the id returned from create-options.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting -import click - @click.command() @click.argument('billing-id') diff --git a/SoftLayer/CLI/loadbal/create_options.py b/SoftLayer/CLI/loadbal/create_options.py index e53966322..fafa2c893 100644 --- a/SoftLayer/CLI/loadbal/create_options.py +++ b/SoftLayer/CLI/loadbal/create_options.py @@ -1,12 +1,12 @@ """Show load balancer options.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/loadbal/detail.py b/SoftLayer/CLI/loadbal/detail.py index 060070b2d..a1d2d2efa 100644 --- a/SoftLayer/CLI/loadbal/detail.py +++ b/SoftLayer/CLI/loadbal/detail.py @@ -1,13 +1,13 @@ """Get Load balancer details.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import loadbal -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/loadbal/group_add.py b/SoftLayer/CLI/loadbal/group_add.py index 7a68a2627..202c6cab9 100644 --- a/SoftLayer/CLI/loadbal/group_add.py +++ b/SoftLayer/CLI/loadbal/group_add.py @@ -1,12 +1,12 @@ """Adds a new load_balancer service.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import loadbal -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/loadbal/group_delete.py b/SoftLayer/CLI/loadbal/group_delete.py index c6c52d361..74980b7bd 100644 --- a/SoftLayer/CLI/loadbal/group_delete.py +++ b/SoftLayer/CLI/loadbal/group_delete.py @@ -1,14 +1,14 @@ """Deletes an existing load balancer service group.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import loadbal -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/loadbal/group_edit.py b/SoftLayer/CLI/loadbal/group_edit.py index b63d7bdf5..c7ed92c87 100644 --- a/SoftLayer/CLI/loadbal/group_edit.py +++ b/SoftLayer/CLI/loadbal/group_edit.py @@ -1,13 +1,13 @@ """Edit an existing load balancer service group.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import loadbal -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/loadbal/group_reset.py b/SoftLayer/CLI/loadbal/group_reset.py index 2ba1bccb2..093230633 100644 --- a/SoftLayer/CLI/loadbal/group_reset.py +++ b/SoftLayer/CLI/loadbal/group_reset.py @@ -1,12 +1,12 @@ """Reset connections on a certain service group.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import loadbal -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/loadbal/health_checks.py b/SoftLayer/CLI/loadbal/health_checks.py index 073116c62..49a12a5cd 100644 --- a/SoftLayer/CLI/loadbal/health_checks.py +++ b/SoftLayer/CLI/loadbal/health_checks.py @@ -1,12 +1,12 @@ """List health check types.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/loadbal/list.py b/SoftLayer/CLI/loadbal/list.py index 7e085c4ee..df44cc33e 100644 --- a/SoftLayer/CLI/loadbal/list.py +++ b/SoftLayer/CLI/loadbal/list.py @@ -1,12 +1,12 @@ """List active load balancers.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/loadbal/routing_methods.py b/SoftLayer/CLI/loadbal/routing_methods.py index a378cc9c8..3ecb9c3e9 100644 --- a/SoftLayer/CLI/loadbal/routing_methods.py +++ b/SoftLayer/CLI/loadbal/routing_methods.py @@ -1,12 +1,12 @@ """List routing methods.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/loadbal/routing_types.py b/SoftLayer/CLI/loadbal/routing_types.py index a7068e5fe..99e3c8655 100644 --- a/SoftLayer/CLI/loadbal/routing_types.py +++ b/SoftLayer/CLI/loadbal/routing_types.py @@ -1,12 +1,12 @@ """List routing types.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/loadbal/service_add.py b/SoftLayer/CLI/loadbal/service_add.py index cffd7a9b5..b97891e78 100644 --- a/SoftLayer/CLI/loadbal/service_add.py +++ b/SoftLayer/CLI/loadbal/service_add.py @@ -1,12 +1,12 @@ """Adds a new load balancer service.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import loadbal -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/loadbal/service_delete.py b/SoftLayer/CLI/loadbal/service_delete.py index dd1df4678..130b2146e 100644 --- a/SoftLayer/CLI/loadbal/service_delete.py +++ b/SoftLayer/CLI/loadbal/service_delete.py @@ -1,14 +1,14 @@ """Deletes an existing load balancer service.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import loadbal -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/loadbal/service_edit.py b/SoftLayer/CLI/loadbal/service_edit.py index 75bddfd6e..c5c8cdb4f 100644 --- a/SoftLayer/CLI/loadbal/service_edit.py +++ b/SoftLayer/CLI/loadbal/service_edit.py @@ -1,13 +1,13 @@ """Edit the properties of a service group.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import loadbal -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/loadbal/service_toggle.py b/SoftLayer/CLI/loadbal/service_toggle.py index faaa455e6..799b4333c 100644 --- a/SoftLayer/CLI/loadbal/service_toggle.py +++ b/SoftLayer/CLI/loadbal/service_toggle.py @@ -1,14 +1,14 @@ """Toggle the status of an existing load balancer service.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import loadbal -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/metadata.py b/SoftLayer/CLI/metadata.py index eadd38240..f85c7aa46 100644 --- a/SoftLayer/CLI/metadata.py +++ b/SoftLayer/CLI/metadata.py @@ -1,13 +1,13 @@ """Find details about this machine.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting -import click - META_CHOICES = [ 'backend_ip', 'backend_mac', diff --git a/SoftLayer/CLI/mq/accounts_list.py b/SoftLayer/CLI/mq/accounts_list.py index 3cadc0fc2..484881b5b 100644 --- a/SoftLayer/CLI/mq/accounts_list.py +++ b/SoftLayer/CLI/mq/accounts_list.py @@ -1,12 +1,12 @@ """List SoftLayer Message Queue Accounts.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/mq/endpoints_list.py b/SoftLayer/CLI/mq/endpoints_list.py index 179663919..556642ccd 100644 --- a/SoftLayer/CLI/mq/endpoints_list.py +++ b/SoftLayer/CLI/mq/endpoints_list.py @@ -1,12 +1,12 @@ """List SoftLayer Message Queue Endpoints.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/mq/ping.py b/SoftLayer/CLI/mq/ping.py index c20437a29..2a8fa2435 100644 --- a/SoftLayer/CLI/mq/ping.py +++ b/SoftLayer/CLI/mq/ping.py @@ -1,12 +1,12 @@ """Ping the SoftLayer Message Queue service.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions -import click - @click.command() @click.option('--datacenter', help="Datacenter, E.G.: dal05") diff --git a/SoftLayer/CLI/mq/queue_add.py b/SoftLayer/CLI/mq/queue_add.py index 807463a94..f54b4f524 100644 --- a/SoftLayer/CLI/mq/queue_add.py +++ b/SoftLayer/CLI/mq/queue_add.py @@ -1,15 +1,14 @@ """Create a queue.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers from SoftLayer.CLI import mq -import click - - @click.command() @click.argument('account-id') @click.argument('queue-name') diff --git a/SoftLayer/CLI/mq/queue_detail.py b/SoftLayer/CLI/mq/queue_detail.py index 7ab01e885..3cd1694d5 100644 --- a/SoftLayer/CLI/mq/queue_detail.py +++ b/SoftLayer/CLI/mq/queue_detail.py @@ -1,12 +1,12 @@ """Detail a queue.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import mq -import click - @click.command() @click.argument('account-id') diff --git a/SoftLayer/CLI/mq/queue_edit.py b/SoftLayer/CLI/mq/queue_edit.py index c281dac78..b19c2c07c 100644 --- a/SoftLayer/CLI/mq/queue_edit.py +++ b/SoftLayer/CLI/mq/queue_edit.py @@ -1,15 +1,14 @@ """Modify a queue.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers from SoftLayer.CLI import mq -import click - - @click.command() @click.argument('account-id') @click.argument('queue-name') diff --git a/SoftLayer/CLI/mq/queue_list.py b/SoftLayer/CLI/mq/queue_list.py index 088f298f1..1059fa3c9 100644 --- a/SoftLayer/CLI/mq/queue_list.py +++ b/SoftLayer/CLI/mq/queue_list.py @@ -1,12 +1,12 @@ """List all queues on an account.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @click.argument('account-id') diff --git a/SoftLayer/CLI/mq/queue_pop.py b/SoftLayer/CLI/mq/queue_pop.py index 661fc9ac0..c2db94c3b 100644 --- a/SoftLayer/CLI/mq/queue_pop.py +++ b/SoftLayer/CLI/mq/queue_pop.py @@ -1,12 +1,12 @@ """Pops a message from a queue.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import mq -import click - @click.command() @click.argument('account-id') diff --git a/SoftLayer/CLI/mq/queue_push.py b/SoftLayer/CLI/mq/queue_push.py index 3cd034aa6..c025dcf94 100644 --- a/SoftLayer/CLI/mq/queue_push.py +++ b/SoftLayer/CLI/mq/queue_push.py @@ -2,12 +2,12 @@ # :license: MIT, see LICENSE for more details. import sys +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import mq -import click - @click.command() @click.argument('account-id') diff --git a/SoftLayer/CLI/mq/queue_remove.py b/SoftLayer/CLI/mq/queue_remove.py index 41fb458b3..4396dac1a 100644 --- a/SoftLayer/CLI/mq/queue_remove.py +++ b/SoftLayer/CLI/mq/queue_remove.py @@ -1,11 +1,11 @@ """Delete a queue or a queued message.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment -import click - @click.command() @click.argument('account-id') diff --git a/SoftLayer/CLI/mq/topic_add.py b/SoftLayer/CLI/mq/topic_add.py index 4276a30e3..88e66d2b8 100644 --- a/SoftLayer/CLI/mq/topic_add.py +++ b/SoftLayer/CLI/mq/topic_add.py @@ -1,15 +1,14 @@ """Create a new topic.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers from SoftLayer.CLI import mq -import click - - @click.command() @click.argument('account-id') @click.argument('topic-name') diff --git a/SoftLayer/CLI/mq/topic_detail.py b/SoftLayer/CLI/mq/topic_detail.py index d7398f8a1..bb0b80349 100644 --- a/SoftLayer/CLI/mq/topic_detail.py +++ b/SoftLayer/CLI/mq/topic_detail.py @@ -1,12 +1,12 @@ """Detail a topic.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import mq -import click - @click.command() @click.argument('account-id') diff --git a/SoftLayer/CLI/mq/topic_list.py b/SoftLayer/CLI/mq/topic_list.py index cd8617f34..f86d13334 100644 --- a/SoftLayer/CLI/mq/topic_list.py +++ b/SoftLayer/CLI/mq/topic_list.py @@ -1,12 +1,12 @@ """List all topics on an account.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @click.argument('account-id') diff --git a/SoftLayer/CLI/mq/topic_push.py b/SoftLayer/CLI/mq/topic_push.py index a478fb930..e0384492f 100644 --- a/SoftLayer/CLI/mq/topic_push.py +++ b/SoftLayer/CLI/mq/topic_push.py @@ -2,12 +2,12 @@ # :license: MIT, see LICENSE for more details. import sys +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import mq -import click - @click.command() @click.argument('account-id') diff --git a/SoftLayer/CLI/mq/topic_remove.py b/SoftLayer/CLI/mq/topic_remove.py index 9c9e293c9..cdfb22c0f 100644 --- a/SoftLayer/CLI/mq/topic_remove.py +++ b/SoftLayer/CLI/mq/topic_remove.py @@ -1,11 +1,11 @@ """Delete a topic.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment -import click - @click.command() @click.argument('account-id') diff --git a/SoftLayer/CLI/mq/topic_subscribe.py b/SoftLayer/CLI/mq/topic_subscribe.py index a6a9b5fb4..226e20103 100644 --- a/SoftLayer/CLI/mq/topic_subscribe.py +++ b/SoftLayer/CLI/mq/topic_subscribe.py @@ -1,12 +1,12 @@ """Create a subscription on a topic.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import mq -import click - @click.command() @click.argument('account-id') diff --git a/SoftLayer/CLI/mq/topic_unsubscribe.py b/SoftLayer/CLI/mq/topic_unsubscribe.py index a61d24514..48d4b4940 100644 --- a/SoftLayer/CLI/mq/topic_unsubscribe.py +++ b/SoftLayer/CLI/mq/topic_unsubscribe.py @@ -1,11 +1,11 @@ """Remove a subscription on a topic.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment -import click - @click.command() @click.argument('account-id') diff --git a/SoftLayer/CLI/nas/credentials.py b/SoftLayer/CLI/nas/credentials.py index db0bf5b1e..43c829d70 100644 --- a/SoftLayer/CLI/nas/credentials.py +++ b/SoftLayer/CLI/nas/credentials.py @@ -1,11 +1,12 @@ """List NAS account credentials.""" # :license: MIT, see LICENSE for more details. + +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/nas/list.py b/SoftLayer/CLI/nas/list.py index d58a3174e..d18aa6c1b 100644 --- a/SoftLayer/CLI/nas/list.py +++ b/SoftLayer/CLI/nas/list.py @@ -1,12 +1,12 @@ """List NAS accounts.""" # :license: MIT, see LICENSE for more details. +import click + from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer import utils -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/rwhois/edit.py b/SoftLayer/CLI/rwhois/edit.py index 69488255f..01854bdc9 100644 --- a/SoftLayer/CLI/rwhois/edit.py +++ b/SoftLayer/CLI/rwhois/edit.py @@ -1,12 +1,12 @@ """Edit the RWhois data on the account.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions -import click - @click.command() @click.option('--abuse', help='Set the abuse email address') diff --git a/SoftLayer/CLI/rwhois/show.py b/SoftLayer/CLI/rwhois/show.py index 96c883f45..63caa611e 100644 --- a/SoftLayer/CLI/rwhois/show.py +++ b/SoftLayer/CLI/rwhois/show.py @@ -1,12 +1,12 @@ """Display the RWhois information for your account.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/server/cancel.py b/SoftLayer/CLI/server/cancel.py index 137563d92..0b6650fc3 100644 --- a/SoftLayer/CLI/server/cancel.py +++ b/SoftLayer/CLI/server/cancel.py @@ -1,14 +1,14 @@ """Cancel a dedicated server.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/server/cancel_reasons.py b/SoftLayer/CLI/server/cancel_reasons.py index e95a5d532..c1d80551c 100644 --- a/SoftLayer/CLI/server/cancel_reasons.py +++ b/SoftLayer/CLI/server/cancel_reasons.py @@ -1,12 +1,12 @@ """Display a list of cancellation reasons.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/server/create.py b/SoftLayer/CLI/server/create.py index 560fb10a2..633b834c0 100644 --- a/SoftLayer/CLI/server/create.py +++ b/SoftLayer/CLI/server/create.py @@ -1,6 +1,8 @@ """Order/create a dedicated server.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions @@ -8,8 +10,6 @@ from SoftLayer.CLI import helpers from SoftLayer.CLI import template -import click - @click.command(epilog="See 'slcli server create-options' for valid options.") @click.option('--hostname', '-H', diff --git a/SoftLayer/CLI/server/create_options.py b/SoftLayer/CLI/server/create_options.py index 8f2c4b8a2..8c005de54 100644 --- a/SoftLayer/CLI/server/create_options.py +++ b/SoftLayer/CLI/server/create_options.py @@ -1,11 +1,12 @@ """Server order options for a given chassis.""" # :license: MIT, see LICENSE for more details. + +import click + from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.managers import hardware -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/server/credentials.py b/SoftLayer/CLI/server/credentials.py index d3001c73f..ca768bbfe 100644 --- a/SoftLayer/CLI/server/credentials.py +++ b/SoftLayer/CLI/server/credentials.py @@ -1,12 +1,13 @@ """List virtual server credentials.""" # :license: MIT, see LICENSE for more details. + +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/server/detail.py b/SoftLayer/CLI/server/detail.py index 909bfc2b8..9c1e5b0ea 100644 --- a/SoftLayer/CLI/server/detail.py +++ b/SoftLayer/CLI/server/detail.py @@ -1,14 +1,14 @@ """Get details for a hardware device.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers from SoftLayer import utils -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/server/edit.py b/SoftLayer/CLI/server/edit.py index d1c21d0b5..fcc86c67a 100644 --- a/SoftLayer/CLI/server/edit.py +++ b/SoftLayer/CLI/server/edit.py @@ -1,13 +1,13 @@ """Edit hardware details.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/server/list.py b/SoftLayer/CLI/server/list.py index 26c58cc72..9b27d7199 100644 --- a/SoftLayer/CLI/server/list.py +++ b/SoftLayer/CLI/server/list.py @@ -1,13 +1,14 @@ """List hardware servers.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import columns as column_helper from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click # pylint: disable=unnecessary-lambda diff --git a/SoftLayer/CLI/server/nic_edit.py b/SoftLayer/CLI/server/nic_edit.py index f0d88c70c..1ffbfc7c0 100644 --- a/SoftLayer/CLI/server/nic_edit.py +++ b/SoftLayer/CLI/server/nic_edit.py @@ -1,12 +1,12 @@ """Manage NIC settings.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/server/power.py b/SoftLayer/CLI/server/power.py index b40c48175..22f32ade5 100644 --- a/SoftLayer/CLI/server/power.py +++ b/SoftLayer/CLI/server/power.py @@ -1,14 +1,14 @@ """Power commands.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/server/reload.py b/SoftLayer/CLI/server/reload.py index 844d423cf..57cb6552d 100644 --- a/SoftLayer/CLI/server/reload.py +++ b/SoftLayer/CLI/server/reload.py @@ -1,14 +1,14 @@ """Reload operating system on a server.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/server/rescue.py b/SoftLayer/CLI/server/rescue.py index 548a3ca0c..6aaca3efa 100644 --- a/SoftLayer/CLI/server/rescue.py +++ b/SoftLayer/CLI/server/rescue.py @@ -1,14 +1,14 @@ """Reboot server into a rescue image.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/server/update_firmware.py b/SoftLayer/CLI/server/update_firmware.py index 0fa39ff82..6e9a7d62a 100644 --- a/SoftLayer/CLI/server/update_firmware.py +++ b/SoftLayer/CLI/server/update_firmware.py @@ -1,14 +1,14 @@ """Update firmware.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/snapshot/cancel.py b/SoftLayer/CLI/snapshot/cancel.py index 4b1d18323..a684f87ff 100644 --- a/SoftLayer/CLI/snapshot/cancel.py +++ b/SoftLayer/CLI/snapshot/cancel.py @@ -1,14 +1,13 @@ """Cancel/Delete iSCSI snapshot.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers -import click - - @click.command() @click.argument('identifier') @environment.pass_env diff --git a/SoftLayer/CLI/snapshot/create.py b/SoftLayer/CLI/snapshot/create.py index dd23d304c..531b4d2eb 100644 --- a/SoftLayer/CLI/snapshot/create.py +++ b/SoftLayer/CLI/snapshot/create.py @@ -1,14 +1,13 @@ """Create a snapshot of an iSCSI volume.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers -import click - - @click.command() @click.argument('identifier') @click.option('--notes', help="An optional note for the snapshot") diff --git a/SoftLayer/CLI/snapshot/create_space.py b/SoftLayer/CLI/snapshot/create_space.py index 7b339fbd3..2636e7d8e 100644 --- a/SoftLayer/CLI/snapshot/create_space.py +++ b/SoftLayer/CLI/snapshot/create_space.py @@ -1,14 +1,13 @@ """Orders snapshot space for given iSCSI.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers -import click - - @click.command() @click.argument('identifier') @click.option('--capacity', diff --git a/SoftLayer/CLI/snapshot/list.py b/SoftLayer/CLI/snapshot/list.py index 3f402b28d..8de8c082c 100644 --- a/SoftLayer/CLI/snapshot/list.py +++ b/SoftLayer/CLI/snapshot/list.py @@ -1,14 +1,14 @@ """List iSCSI Snapshots.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers from SoftLayer import utils -import click - @click.command() @click.argument('iscsi-identifier') diff --git a/SoftLayer/CLI/snapshot/restore_volume.py b/SoftLayer/CLI/snapshot/restore_volume.py index 676d7d0ec..7fa4168ad 100644 --- a/SoftLayer/CLI/snapshot/restore_volume.py +++ b/SoftLayer/CLI/snapshot/restore_volume.py @@ -1,14 +1,13 @@ """Restores volume from existing snapshot.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers -import click - - @click.command() @click.argument('snapshot-id') @click.argument('volume-id') diff --git a/SoftLayer/CLI/sshkey/add.py b/SoftLayer/CLI/sshkey/add.py index 7cd174bcc..49920a070 100644 --- a/SoftLayer/CLI/sshkey/add.py +++ b/SoftLayer/CLI/sshkey/add.py @@ -2,11 +2,11 @@ # :license: MIT, see LICENSE for more details. from os import path +import click + import SoftLayer from SoftLayer.CLI import environment -import click - @click.command() @click.argument('label') diff --git a/SoftLayer/CLI/sshkey/edit.py b/SoftLayer/CLI/sshkey/edit.py index c5feb9c19..157183711 100644 --- a/SoftLayer/CLI/sshkey/edit.py +++ b/SoftLayer/CLI/sshkey/edit.py @@ -1,13 +1,13 @@ """Edits an SSH key.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/sshkey/list.py b/SoftLayer/CLI/sshkey/list.py index 977742cfe..22a11db03 100644 --- a/SoftLayer/CLI/sshkey/list.py +++ b/SoftLayer/CLI/sshkey/list.py @@ -1,12 +1,12 @@ """List SSH keys.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @click.option('--sortby', diff --git a/SoftLayer/CLI/sshkey/print.py b/SoftLayer/CLI/sshkey/print.py index 92ff059d3..4697353e2 100644 --- a/SoftLayer/CLI/sshkey/print.py +++ b/SoftLayer/CLI/sshkey/print.py @@ -2,13 +2,13 @@ # :license: MIT, see LICENSE for more details. from os import path +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/sshkey/remove.py b/SoftLayer/CLI/sshkey/remove.py index 77efe1725..cb71cc587 100644 --- a/SoftLayer/CLI/sshkey/remove.py +++ b/SoftLayer/CLI/sshkey/remove.py @@ -1,14 +1,14 @@ """Permanently removes an SSH key.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/ssl/add.py b/SoftLayer/CLI/ssl/add.py index 08b8c3431..c017cb5b3 100644 --- a/SoftLayer/CLI/ssl/add.py +++ b/SoftLayer/CLI/ssl/add.py @@ -1,11 +1,11 @@ """Add and upload SSL certificate details.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment -import click - @click.command() @click.option('--crt', diff --git a/SoftLayer/CLI/ssl/download.py b/SoftLayer/CLI/ssl/download.py index 22f1e2636..77b5247b2 100644 --- a/SoftLayer/CLI/ssl/download.py +++ b/SoftLayer/CLI/ssl/download.py @@ -1,11 +1,11 @@ """Download SSL certificate and key file.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/ssl/edit.py b/SoftLayer/CLI/ssl/edit.py index 1f721e824..4893ebf8f 100644 --- a/SoftLayer/CLI/ssl/edit.py +++ b/SoftLayer/CLI/ssl/edit.py @@ -1,11 +1,11 @@ """Edit SSL certificate.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/ssl/list.py b/SoftLayer/CLI/ssl/list.py index 6783a7db2..07483bd30 100644 --- a/SoftLayer/CLI/ssl/list.py +++ b/SoftLayer/CLI/ssl/list.py @@ -1,12 +1,12 @@ """List SSL certificates.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @click.option('--status', diff --git a/SoftLayer/CLI/ssl/remove.py b/SoftLayer/CLI/ssl/remove.py index 3f8e7fa11..ba7dfee86 100644 --- a/SoftLayer/CLI/ssl/remove.py +++ b/SoftLayer/CLI/ssl/remove.py @@ -1,13 +1,13 @@ """Remove SSL certificate.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/subnet/cancel.py b/SoftLayer/CLI/subnet/cancel.py index 2ab9010bd..42e8caa28 100644 --- a/SoftLayer/CLI/subnet/cancel.py +++ b/SoftLayer/CLI/subnet/cancel.py @@ -1,14 +1,14 @@ """Cancel a subnet.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/subnet/create.py b/SoftLayer/CLI/subnet/create.py index 69b44a794..0f81c574b 100644 --- a/SoftLayer/CLI/subnet/create.py +++ b/SoftLayer/CLI/subnet/create.py @@ -1,15 +1,14 @@ """Add a new subnet to your account.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting -import click - - @click.command(short_help="Add a new subnet to your account") @click.argument('network', type=click.Choice(['public', 'private'])) @click.argument('quantity', type=click.INT) diff --git a/SoftLayer/CLI/subnet/detail.py b/SoftLayer/CLI/subnet/detail.py index 05bc05935..b353bfdf7 100644 --- a/SoftLayer/CLI/subnet/detail.py +++ b/SoftLayer/CLI/subnet/detail.py @@ -1,13 +1,13 @@ """Get subnet details.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/subnet/list.py b/SoftLayer/CLI/subnet/list.py index 23b11653f..17ffe8a16 100644 --- a/SoftLayer/CLI/subnet/list.py +++ b/SoftLayer/CLI/subnet/list.py @@ -1,15 +1,14 @@ """List subnets.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer import utils -import click - - @click.command() @click.option('--sortby', help='Column to sort by', diff --git a/SoftLayer/CLI/subnet/lookup.py b/SoftLayer/CLI/subnet/lookup.py index cc28ceeb1..0268caaba 100644 --- a/SoftLayer/CLI/subnet/lookup.py +++ b/SoftLayer/CLI/subnet/lookup.py @@ -1,15 +1,14 @@ """Find an IP address and display its subnet and device info.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting -import click - - @click.command() @click.argument('ip_address') @environment.pass_env diff --git a/SoftLayer/CLI/summary.py b/SoftLayer/CLI/summary.py index 3bc6dcfc7..9e0d59f2c 100644 --- a/SoftLayer/CLI/summary.py +++ b/SoftLayer/CLI/summary.py @@ -1,12 +1,12 @@ """Account summary.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @click.option('--sortby', diff --git a/SoftLayer/CLI/ticket/__init__.py b/SoftLayer/CLI/ticket/__init__.py index 6d3fdf9c4..4759b5e0f 100644 --- a/SoftLayer/CLI/ticket/__init__.py +++ b/SoftLayer/CLI/ticket/__init__.py @@ -1,9 +1,9 @@ """Support tickets.""" -from SoftLayer.CLI import formatting - import click +from SoftLayer.CLI import formatting + TEMPLATE_MSG = "***** SoftLayer Ticket Content ******" diff --git a/SoftLayer/CLI/ticket/create.py b/SoftLayer/CLI/ticket/create.py index fc5867b6b..82f81ee83 100644 --- a/SoftLayer/CLI/ticket/create.py +++ b/SoftLayer/CLI/ticket/create.py @@ -1,12 +1,12 @@ """Create a support ticket.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import ticket -import click - @click.command() @click.option('--title', required=True, help="The title of the ticket") diff --git a/SoftLayer/CLI/ticket/detail.py b/SoftLayer/CLI/ticket/detail.py index 8d7f59f7c..6d45de0ed 100644 --- a/SoftLayer/CLI/ticket/detail.py +++ b/SoftLayer/CLI/ticket/detail.py @@ -1,13 +1,13 @@ """Get details for a ticket.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers from SoftLayer.CLI import ticket -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/ticket/list.py b/SoftLayer/CLI/ticket/list.py index 52f8a4d9b..d7c72794a 100644 --- a/SoftLayer/CLI/ticket/list.py +++ b/SoftLayer/CLI/ticket/list.py @@ -1,14 +1,13 @@ """List tickets.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - - @click.command() @click.option('--open / --closed', 'is_open', help="Display only open or closed tickets", diff --git a/SoftLayer/CLI/ticket/subjects.py b/SoftLayer/CLI/ticket/subjects.py index 12173be3a..6b035c821 100644 --- a/SoftLayer/CLI/ticket/subjects.py +++ b/SoftLayer/CLI/ticket/subjects.py @@ -1,14 +1,13 @@ """List Subject IDs for ticket creation.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - - @click.command() @environment.pass_env def cli(env): diff --git a/SoftLayer/CLI/ticket/summary.py b/SoftLayer/CLI/ticket/summary.py index d42e179f0..c871c6371 100644 --- a/SoftLayer/CLI/ticket/summary.py +++ b/SoftLayer/CLI/ticket/summary.py @@ -1,11 +1,11 @@ """Summary info about tickets.""" # :license: MIT, see LICENSE for more details. +import click + from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/ticket/update.py b/SoftLayer/CLI/ticket/update.py index b410166e9..9c10971ad 100644 --- a/SoftLayer/CLI/ticket/update.py +++ b/SoftLayer/CLI/ticket/update.py @@ -1,13 +1,13 @@ """Adds an update to an existing ticket.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers from SoftLayer.CLI import ticket -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/virt/cancel.py b/SoftLayer/CLI/virt/cancel.py index 90a8df1a9..f004985b8 100644 --- a/SoftLayer/CLI/virt/cancel.py +++ b/SoftLayer/CLI/virt/cancel.py @@ -1,6 +1,7 @@ """Cancel virtual servers.""" # :license: MIT, see LICENSE for more details. +import click import SoftLayer from SoftLayer.CLI import environment @@ -8,8 +9,6 @@ from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/virt/capture.py b/SoftLayer/CLI/virt/capture.py index dcfb64df1..b116d61dc 100644 --- a/SoftLayer/CLI/virt/capture.py +++ b/SoftLayer/CLI/virt/capture.py @@ -1,14 +1,15 @@ """Capture virtual server image.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click -# pylint: disable=redefined-builtin +# pylint: disable=redefined-builtin @click.command(short_help="Capture SoftLayer image.") @click.argument('identifier') diff --git a/SoftLayer/CLI/virt/create.py b/SoftLayer/CLI/virt/create.py index 897217509..f81ed32fd 100644 --- a/SoftLayer/CLI/virt/create.py +++ b/SoftLayer/CLI/virt/create.py @@ -1,6 +1,8 @@ """Manage, delete, order compute instances.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions @@ -10,8 +12,6 @@ from SoftLayer.CLI import virt from SoftLayer import utils -import click - def _update_with_like_args(ctx, _, value): """Update arguments with options taken from a currently running VS.""" diff --git a/SoftLayer/CLI/virt/create_options.py b/SoftLayer/CLI/virt/create_options.py index ed5a93d1f..4b2feb7a0 100644 --- a/SoftLayer/CLI/virt/create_options.py +++ b/SoftLayer/CLI/virt/create_options.py @@ -1,15 +1,14 @@ """Virtual server order options.""" # :license: MIT, see LICENSE for more details. - import os import os.path +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting -import click - @click.command() @environment.pass_env diff --git a/SoftLayer/CLI/virt/credentials.py b/SoftLayer/CLI/virt/credentials.py index c137007af..c646a007b 100644 --- a/SoftLayer/CLI/virt/credentials.py +++ b/SoftLayer/CLI/virt/credentials.py @@ -1,12 +1,13 @@ """List virtual server credentials.""" # :license: MIT, see LICENSE for more details. + +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/virt/detail.py b/SoftLayer/CLI/virt/detail.py index b12845aae..c681d8a5d 100644 --- a/SoftLayer/CLI/virt/detail.py +++ b/SoftLayer/CLI/virt/detail.py @@ -1,14 +1,14 @@ """Get details for a virtual server.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers from SoftLayer import utils -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/virt/dns.py b/SoftLayer/CLI/virt/dns.py index b0e6cce39..e5e0fdc7e 100644 --- a/SoftLayer/CLI/virt/dns.py +++ b/SoftLayer/CLI/virt/dns.py @@ -1,14 +1,14 @@ """Sync DNS records.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command(epilog="""If you don't specify any arguments, it will attempt to update both the A and PTR records. If you don't diff --git a/SoftLayer/CLI/virt/edit.py b/SoftLayer/CLI/virt/edit.py index b7a7416a3..ec6cd1c7b 100644 --- a/SoftLayer/CLI/virt/edit.py +++ b/SoftLayer/CLI/virt/edit.py @@ -1,13 +1,13 @@ """Edit a virtual server's details.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/virt/list.py b/SoftLayer/CLI/virt/list.py index 90fbee13c..81164211d 100644 --- a/SoftLayer/CLI/virt/list.py +++ b/SoftLayer/CLI/virt/list.py @@ -1,13 +1,14 @@ """List virtual servers.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import columns as column_helper from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click # pylint: disable=unnecessary-lambda diff --git a/SoftLayer/CLI/virt/network.py b/SoftLayer/CLI/virt/network.py index 7ef27a4ab..c41f6f564 100644 --- a/SoftLayer/CLI/virt/network.py +++ b/SoftLayer/CLI/virt/network.py @@ -1,12 +1,12 @@ """Manage network settings.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/virt/power.py b/SoftLayer/CLI/virt/power.py index c0d12f92c..f3c04a9b7 100644 --- a/SoftLayer/CLI/virt/power.py +++ b/SoftLayer/CLI/virt/power.py @@ -1,14 +1,14 @@ """Command lines which modify power states.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/virt/ready.py b/SoftLayer/CLI/virt/ready.py index 7a4b74ac1..8c708dc40 100644 --- a/SoftLayer/CLI/virt/ready.py +++ b/SoftLayer/CLI/virt/ready.py @@ -1,13 +1,13 @@ """Check if a virtual server is ready.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/virt/reload.py b/SoftLayer/CLI/virt/reload.py index b805306e2..39967ae3c 100644 --- a/SoftLayer/CLI/virt/reload.py +++ b/SoftLayer/CLI/virt/reload.py @@ -1,14 +1,14 @@ """Reload the OS on a virtual server.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - @click.command() @click.argument('identifier') diff --git a/SoftLayer/CLI/virt/upgrade.py b/SoftLayer/CLI/virt/upgrade.py index c4c06c4f6..8caa049f9 100644 --- a/SoftLayer/CLI/virt/upgrade.py +++ b/SoftLayer/CLI/virt/upgrade.py @@ -1,6 +1,8 @@ """Upgrade a virtual server.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions @@ -8,8 +10,6 @@ from SoftLayer.CLI import helpers from SoftLayer.CLI import virt -import click - @click.command(epilog="""Note: SoftLayer automatically reboots the VS once upgrade request is placed. The VS is halted until the Upgrade transaction is diff --git a/SoftLayer/CLI/vlan/detail.py b/SoftLayer/CLI/vlan/detail.py index 5bb64208b..14782b09a 100644 --- a/SoftLayer/CLI/vlan/detail.py +++ b/SoftLayer/CLI/vlan/detail.py @@ -1,15 +1,14 @@ """Get details about a VLAN.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers -import click - - @click.command() @click.argument('identifier') @click.option('--no-vs', diff --git a/SoftLayer/CLI/vlan/list.py b/SoftLayer/CLI/vlan/list.py index 2215a38e5..3493ebfdf 100644 --- a/SoftLayer/CLI/vlan/list.py +++ b/SoftLayer/CLI/vlan/list.py @@ -1,15 +1,14 @@ """List VLANs.""" # :license: MIT, see LICENSE for more details. +import click + import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer import utils -import click - - @click.command() @click.option('--sortby', help='Column to sort by', diff --git a/SoftLayer/managers/cdn.py b/SoftLayer/managers/cdn.py index 2f70c50fb..a805ed396 100644 --- a/SoftLayer/managers/cdn.py +++ b/SoftLayer/managers/cdn.py @@ -5,10 +5,10 @@ :license: MIT, see LICENSE for more details. """ -from SoftLayer import utils - import six +from SoftLayer import utils + MAX_URLS_PER_LOAD = 5 MAX_URLS_PER_PURGE = 5 diff --git a/SoftLayer/managers/hardware.py b/SoftLayer/managers/hardware.py index 16951172e..6ffae04d1 100644 --- a/SoftLayer/managers/hardware.py +++ b/SoftLayer/managers/hardware.py @@ -576,7 +576,7 @@ def _get_extra_price_id(items, key_name, hourly, location): """Returns a price id attached to item with the given key_name.""" for item in items: - if not utils.lookup(item, 'keyName') == key_name: + if utils.lookup(item, 'keyName') != key_name: continue for price in item['prices']: @@ -596,7 +596,7 @@ def _get_default_price_id(items, option, hourly, location): """Returns a 'free' price id given an option.""" for item in items: - if not utils.lookup(item, 'itemCategory', 'categoryCode') == option: + if utils.lookup(item, 'itemCategory', 'categoryCode') != option: continue for price in item['prices']: @@ -621,9 +621,9 @@ def _get_bandwidth_price_id(items, capacity = float(item.get('capacity', 0)) # Hourly and private only do pay-as-you-go bandwidth - if any([not utils.lookup(item, - 'itemCategory', - 'categoryCode') == 'bandwidth', + if any([utils.lookup(item, + 'itemCategory', + 'categoryCode') != 'bandwidth', (hourly or no_public) and capacity != 0.0, not (hourly or no_public) and capacity == 0.0]): continue @@ -644,12 +644,12 @@ def _get_os_price_id(items, os, location): """Returns the price id matching.""" for item in items: - if any([not utils.lookup(item, - 'itemCategory', - 'categoryCode') == 'os', - not utils.lookup(item, - 'softwareDescription', - 'referenceCode') == os]): + if any([utils.lookup(item, + 'itemCategory', + 'categoryCode') != 'os', + utils.lookup(item, + 'softwareDescription', + 'referenceCode') != os]): continue for price in item['prices']: @@ -666,9 +666,9 @@ def _get_port_speed_price_id(items, port_speed, no_public, location): """Choose a valid price id for port speed.""" for item in items: - if not utils.lookup(item, - 'itemCategory', - 'categoryCode') == 'port_speed': + if utils.lookup(item, + 'itemCategory', + 'categoryCode') != 'port_speed': continue # Check for correct capacity and if the item matches private only diff --git a/SoftLayer/managers/image.py b/SoftLayer/managers/image.py index 88af48253..57389bd89 100644 --- a/SoftLayer/managers/image.py +++ b/SoftLayer/managers/image.py @@ -114,10 +114,8 @@ def edit(self, image_id, name=None, note=None, tag=None): self.vgbdtg.editObject(obj, id=image_id) if tag: self.vgbdtg.setTags(str(tag), id=image_id) - if name or note or tag: - return True - else: - return False + + return bool(name or note or tag) def import_image_from_uri(self, name, uri, os_code=None, note=None): """Import a new image from object storage. diff --git a/SoftLayer/managers/vs.py b/SoftLayer/managers/vs.py index e48aaead5..a5646b9a8 100644 --- a/SoftLayer/managers/vs.py +++ b/SoftLayer/managers/vs.py @@ -799,8 +799,8 @@ def _get_item_id_for_upgrade(self, package_items, option, value, vs_id = {'memory': 3, 'cpus': 80, 'nic_speed': 26} for item in package_items: categories = item['prices'][0]['categories'] - for j in range(len(categories)): - if not (categories[j]['id'] == vs_id[option] and + for category in categories: + if not (category['id'] == vs_id[option] and item['capacity'] == str(value)): continue if option == 'cpus': diff --git a/SoftLayer/shell/completer.py b/SoftLayer/shell/completer.py index 40f3c8439..e0ca661dd 100644 --- a/SoftLayer/shell/completer.py +++ b/SoftLayer/shell/completer.py @@ -7,11 +7,11 @@ """ import shlex -from SoftLayer.CLI import core - import click from prompt_toolkit import completion as completion +from SoftLayer.CLI import core + class ShellCompleter(completion.Completer): """Completer for the shell.""" diff --git a/SoftLayer/testing/__init__.py b/SoftLayer/testing/__init__.py index cca90f43c..328a6fcf6 100644 --- a/SoftLayer/testing/__init__.py +++ b/SoftLayer/testing/__init__.py @@ -9,14 +9,15 @@ import logging import os.path +from click import testing +import mock +import testtools + import SoftLayer from SoftLayer.CLI import core from SoftLayer.CLI import environment from SoftLayer.testing import xmlrpc -from click import testing -import mock -import testtools FIXTURE_PATH = os.path.abspath(os.path.join(__file__, '..', '..', 'fixtures')) diff --git a/SoftLayer/transports.py b/SoftLayer/transports.py index 9bcbb4345..6e2861db1 100644 --- a/SoftLayer/transports.py +++ b/SoftLayer/transports.py @@ -5,10 +5,6 @@ :license: MIT, see LICENSE for more details. """ -from SoftLayer import consts -from SoftLayer import exceptions -from SoftLayer import utils - import importlib import json import logging @@ -16,6 +12,10 @@ import requests +from SoftLayer import consts +from SoftLayer import exceptions +from SoftLayer import utils + LOGGER = logging.getLogger(__name__) # transports.Request does have a lot of instance attributes. :( # pylint: disable=too-many-instance-attributes diff --git a/SoftLayer/utils.py b/SoftLayer/utils.py index 9ef59e583..035461784 100644 --- a/SoftLayer/utils.py +++ b/SoftLayer/utils.py @@ -10,7 +10,7 @@ import six -# pylint: disable=pointless-except, no-member, invalid-name +# pylint: disable=no-member, invalid-name UUID_RE = re.compile(r'^[0-9a-f\-]{36}$', re.I) KNOWN_OPERATIONS = ['<=', '>=', '<', '>', '~', '!~', '*=', '^=', '$=', '_='] @@ -37,7 +37,7 @@ def lookup(dic, key, *keys): """ if keys: - return lookup(dic.get(key, {}), *keys) + return lookup(dic.get(key, {}), keys[0], *keys[1:]) return dic.get(key) diff --git a/tox.ini b/tox.ini index c5d95e0e1..c66359f13 100644 --- a/tox.ini +++ b/tox.ini @@ -26,6 +26,7 @@ commands = --ignore=tests,fixtures \ -d too-many-locals \ -d star-args \ + -d redefined-variable-type \ # This prevents polymorphism -d locally-disabled \ --max-args=20 \ --max-branches=20 \