Skip to content

Commit fd63a90

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Bump hacking version"
2 parents c9cc8b0 + 6419533 commit fd63a90

9 files changed

Lines changed: 40 additions & 42 deletions

File tree

lower-constraints.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ extras==1.0.0
2222
fasteners==0.7.0
2323
fixtures==3.0.0
2424
flake8-import-order==0.13
25-
flake8==2.5.5
25+
flake8==2.6.2
2626
future==0.16.0
2727
futurist==1.2.0
2828
gitdb==0.6.4
2929
GitPython==1.0.1
3030
gnocchiclient==3.3.1
3131
greenlet==0.4.10
32-
hacking==0.12.0
32+
hacking==1.1.0
3333
httplib2==0.9.1
3434
idna==2.6
3535
iso8601==0.1.11
@@ -71,14 +71,13 @@ paramiko==2.0.0
7171
Paste==2.0.2
7272
PasteDeploy==1.5.0
7373
pbr==2.0.0
74-
pep8==1.5.7
7574
pika-pool==0.1.3
7675
pika==0.10.0
7776
ply==3.10
7877
positional==1.2.1
7978
prettytable==0.7.2
8079
pyasn1==0.1.8
81-
pycodestyle==2.3.1
80+
pycodestyle==2.0.0
8281
pycparser==2.18
8382
pyflakes==0.8.1
8483
pyinotify==0.9.6

openstackclient/compute/v2/hypervisor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def take_action(self, parsed_args):
112112
# example: 17:37:14 up 2:33, 3 users,
113113
# load average: 0.33, 0.36, 0.34
114114
m = re.match(
115-
"\s*(.+)\sup\s+(.+),\s+(.+)\susers?,\s+load average:\s(.+)",
115+
r"\s*(.+)\sup\s+(.+),\s+(.+)\susers?,\s+load average:\s(.+)",
116116
uptime['uptime'])
117117
if m:
118118
hypervisor["host_time"] = m.group(1)

openstackclient/compute/v2/server.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -79,37 +79,37 @@ def _format_servers_list_power_state(state):
7979

8080

8181
def _get_ip_address(addresses, address_type, ip_address_family):
82-
# Old style addresses
83-
if address_type in addresses:
84-
for addy in addresses[address_type]:
82+
# Old style addresses
83+
if address_type in addresses:
84+
for addy in addresses[address_type]:
85+
if int(addy['version']) in ip_address_family:
86+
return addy['addr']
87+
88+
# New style addresses
89+
new_address_type = address_type
90+
if address_type == 'public':
91+
new_address_type = 'floating'
92+
if address_type == 'private':
93+
new_address_type = 'fixed'
94+
for network in addresses:
95+
for addy in addresses[network]:
96+
# Case where it is list of strings
97+
if isinstance(addy, six.string_types):
98+
if new_address_type == 'fixed':
99+
return addresses[network][0]
100+
else:
101+
return addresses[network][-1]
102+
# Case where it is a dict
103+
if 'OS-EXT-IPS:type' not in addy:
104+
continue
105+
if addy['OS-EXT-IPS:type'] == new_address_type:
85106
if int(addy['version']) in ip_address_family:
86107
return addy['addr']
87-
88-
# New style addresses
89-
new_address_type = address_type
90-
if address_type == 'public':
91-
new_address_type = 'floating'
92-
if address_type == 'private':
93-
new_address_type = 'fixed'
94-
for network in addresses:
95-
for addy in addresses[network]:
96-
# Case where it is list of strings
97-
if isinstance(addy, six.string_types):
98-
if new_address_type == 'fixed':
99-
return addresses[network][0]
100-
else:
101-
return addresses[network][-1]
102-
# Case where it is a dict
103-
if 'OS-EXT-IPS:type' not in addy:
104-
continue
105-
if addy['OS-EXT-IPS:type'] == new_address_type:
106-
if int(addy['version']) in ip_address_family:
107-
return addy['addr']
108-
msg = _("ERROR: No %(type)s IP version %(family)s address found")
109-
raise exceptions.CommandError(
110-
msg % {"type": address_type,
111-
"family": ip_address_family}
112-
)
108+
msg = _("ERROR: No %(type)s IP version %(family)s address found")
109+
raise exceptions.CommandError(
110+
msg % {"type": address_type,
111+
"family": ip_address_family}
112+
)
113113

114114

115115
def _prefix_checked_value(prefix):

openstackclient/network/v2/network_segment_range.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def take_action(self, parsed_args):
358358
parsed_args.used and _is_prop_empty(columns, props, 'used') or \
359359
parsed_args.unused and \
360360
not _is_prop_empty(columns, props, 'used'):
361-
continue
361+
continue
362362
if parsed_args.long:
363363
props = _update_additional_fields_from_props(columns, props)
364364
display_props += (props,)

openstackclient/shell.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,6 @@ def main(argv=None):
209209

210210
return OpenStackShell().run(argv)
211211

212+
212213
if __name__ == "__main__":
213214
sys.exit(main())

openstackclient/tests/unit/compute/v2/fakes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ def create_security_groups(attrs=None, count=2):
505505

506506
@staticmethod
507507
def get_security_groups(security_groups=None, count=2):
508-
"""Get an iterable MagicMock object with a list of faked security groups.
508+
"""Get an iterable MagicMock with a list of faked security groups.
509509
510510
If security groups list is provided, then initialize the Mock object
511511
with the list. Otherwise create one.

openstackclient/tests/unit/network/v2/fakes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,7 @@ def create_security_group_rules(attrs=None, count=2):
13441344

13451345
@staticmethod
13461346
def get_security_group_rules(security_group_rules=None, count=2):
1347-
"""Get an iterable Mock object with a list of faked security group rules.
1347+
"""Get an iterable Mock with a list of faked security group rules.
13481348
13491349
If security group rules list is provided, then initialize the Mock
13501350
object with the list. Otherwise create one.

test-requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# The order of packages is significant, because pip processes them in the order
22
# of appearance. Changing the order has an impact on the overall integration
33
# process, which may cause wedges in the gate later.
4-
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
5-
4+
hacking>=1.1.0,<1.2.0 # Apache-2.0
65
coverage!=4.4,>=4.0 # Apache-2.0
76
fixtures>=3.0.0 # Apache-2.0/BSD
87
flake8-import-order==0.13 # LGPLv3

tox.ini

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,8 @@ show-source = True
132132
# H203: Use assertIs(Not)None to check for None
133133
enable-extensions = H203
134134
exclude = .git,.tox,dist,doc,*lib/python*,*egg,build,tools
135-
# If 'ignore' is not set there are default errors and warnings that are set
136-
# Doc: http://flake8.readthedocs.org/en/latest/config.html#default
137-
ignore = __
135+
# W504 is disabled since you must choose between this or W503
136+
ignore = W504
138137
import-order-style = pep8
139138
application_import_names = openstackclient
140139

0 commit comments

Comments
 (0)