Skip to content

Commit adfdc89

Browse files
committed
pep8 cleanup
1 parent 714e314 commit adfdc89

5 files changed

Lines changed: 31 additions & 15 deletions

File tree

consulate/api/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,16 @@
1212
from consulate.api.session import Session
1313
from consulate.api.status import Status
1414
from consulate.api.base import Response
15+
16+
__all__ = [
17+
ACL,
18+
Agent,
19+
Catalog,
20+
Event,
21+
Health,
22+
KV,
23+
Lock,
24+
Session,
25+
Status,
26+
Response
27+
]

consulate/api/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
except ImportError: # pragma: no cover
1010
from urllib import urlencode # Python 2
1111

12-
from consulate import exceptions
1312
from consulate import utils
1413

1514

consulate/api/catalog.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ def register(self, node, address,
9494

9595
return self._put_response_body(['register'], None, payload)
9696

97-
def deregister(self, node, datacenter=None, check_id=None, service_id=None):
97+
def deregister(self, node, datacenter=None,
98+
check_id=None, service_id=None):
9899
"""Directly remove entries in the catalog. It is usually recommended
99100
to use the agent local endpoints, as they are simpler and perform
100101
anti-entropy.

consulate/api/lock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import uuid
88

99
from consulate.api import base
10-
from consulate import utils, exceptions
10+
from consulate import exceptions
1111

1212
LOGGER = logging.getLogger(__name__)
1313

consulate/cli.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,22 @@ def connection_error():
5555

5656
KV_PARSERS = [
5757
('backup', 'Backup to stdout or a JSON file', [
58-
[['key'], {'help': 'The key to use as target to backup a specific key or folder.',
59-
'nargs':'?'}],
58+
[['key'], {'help': 'The key to use as target to backup a '
59+
'specific key or folder.',
60+
'nargs': '?'}],
6061
[['-b', '--base64'], {'help': 'Base64 encode values',
6162
'action': 'store_true'}],
6263
[['-f', '--file'], {'help': 'JSON file to write instead of stdout',
6364
'nargs': '?'}],
6465
[['-p', '--pretty'], {'help': 'pretty-print JSON output',
6566
'action': 'store_true'}]]),
6667
('restore', 'Restore from stdin or a JSON file', [
67-
[['key'], {'help': 'The key as target to restore to a specific key or folder.',
68-
'nargs':'?'}],
69-
[['-p', '--prune'], {'help':'Remove entries from consul tree that are not in restore file.',
70-
'action': 'store_true'}],
68+
[['key'], {'help': 'The key as target to restore to a specific key '
69+
'or folder.',
70+
'nargs': '?'}],
71+
[['-p', '--prune'], {'help': 'Remove entries from consul tree that '
72+
'are not in restore file.',
73+
'action': 'store_true'}],
7174
[['-b', '--base64'], {'help': 'Restore from Base64 encode values',
7275
'action': 'store_true'}],
7376
[['-f', '--file'],
@@ -77,8 +80,9 @@ def connection_error():
7780
{'help': 'Do not replace existing entries',
7881
'action': 'store_true'}]]),
7982
('ls', 'List all of the keys', [
80-
[['key'], {'help': 'The key to use as target to list contents of specific key or folder',
81-
'nargs':'?'}],
83+
[['key'], {'help': 'The key to use as target to list contents of '
84+
'specific key or folder',
85+
'nargs': '?'}],
8286
[['-l', '--long'],
8387
{'help': 'Long format',
8488
'action': 'store_true'}]]),
@@ -165,11 +169,11 @@ def add_register_args(parser):
165169
check.add_argument('path', default=None,
166170
help='Path to the script invoked by Consul')
167171
httpcheck = rsparsers.add_parser('httpcheck',
168-
help='Define an HTTP-based check')
172+
help='Define an HTTP-based check')
169173
httpcheck.add_argument('interval', default=10, type=int,
170-
help='How often to run the check script')
174+
help='How often to run the check script')
171175
httpcheck.add_argument('url', default=None,
172-
help='HTTP URL to be polled by Consul')
176+
help='HTTP URL to be polled by Consul')
173177
rsparsers.add_parser('no-check', help='Do not enable service monitoring')
174178
ttl = rsparsers.add_parser('ttl', help='Define a duration based TTL check')
175179
ttl.add_argument('duration', type=int, default=10,
@@ -436,7 +440,6 @@ def kv_restore(consul, args):
436440
consul.kv.delete(key)
437441
except exceptions.ConnectionError:
438442
connection_error()
439-
440443

441444

442445
def kv_rm(consul, args):

0 commit comments

Comments
 (0)