Skip to content
Merged
Prev Previous commit
Next Next commit
fix E501
  • Loading branch information
wing328 committed Jan 24, 2019
commit 3b539eceb9ab624d66767523a9248500bab02647
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)):
# check array index out of bound
if index < 0 or index > len(servers):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the second expression should be >=

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Just pushed out a fix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI. I'm also reviewing other clients and filing a fix accordingly if the same issue is found.

raise ValueError(
"Invalid index {} when selecting the host settings. Must be less than {}"
"Invalid index {} when selecting the host settings. Must be less than {}" # noqa: E501
.format(index, len(servers)))

server = servers[index]
Expand All @@ -310,7 +310,7 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)):
variables[variable_name])
else:
raise ValueError(
"The variable `{}` in the host URL has invalid value {}. Must be {}."
"The variable `{}` in the host URL has invalid value {}. Must be {}." # noqa: E501
.format(
variable_name, variables[variable_name],
server['variables'][variable_name]['enum_values']))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def get_host_from_settings(self, index, variables={}):
# check array index out of bound
if index < 0 or index > len(servers):
raise ValueError(
"Invalid index {} when selecting the host settings. Must be less than {}"
"Invalid index {} when selecting the host settings. Must be less than {}" # noqa: E501
.format(index, len(servers)))

server = servers[index]
Expand All @@ -298,7 +298,7 @@ def get_host_from_settings(self, index, variables={}):
variables[variable_name])
else:
raise ValueError(
"The variable `{}` in the host URL has invalid value {}. Must be {}."
"The variable `{}` in the host URL has invalid value {}. Must be {}." # noqa: E501
.format(
variable_name, variables[variable_name],
server['variables'][variable_name]['enum_values']))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def get_host_from_settings(self, index, variables={}):
# check array index out of bound
if index < 0 or index > len(servers):
raise ValueError(
"Invalid index {} when selecting the host settings. Must be less than {}"
"Invalid index {} when selecting the host settings. Must be less than {}" # noqa: E501
.format(index, len(servers)))

server = servers[index]
Expand All @@ -298,7 +298,7 @@ def get_host_from_settings(self, index, variables={}):
variables[variable_name])
else:
raise ValueError(
"The variable `{}` in the host URL has invalid value {}. Must be {}."
"The variable `{}` in the host URL has invalid value {}. Must be {}." # noqa: E501
.format(
variable_name, variables[variable_name],
server['variables'][variable_name]['enum_values']))
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/python/petstore_api/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def get_host_from_settings(self, index, variables={}):
# check array index out of bound
if index < 0 or index > len(servers):
raise ValueError(
"Invalid index {} when selecting the host settings. Must be less than {}"
"Invalid index {} when selecting the host settings. Must be less than {}" # noqa: E501
.format(index, len(servers)))

server = servers[index]
Expand All @@ -298,7 +298,7 @@ def get_host_from_settings(self, index, variables={}):
variables[variable_name])
else:
raise ValueError(
"The variable `{}` in the host URL has invalid value {}. Must be {}."
"The variable `{}` in the host URL has invalid value {}. Must be {}." # noqa: E501
.format(
variable_name, variables[variable_name],
server['variables'][variable_name]['enum_values']))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def get_host_from_settings(self, index, variables={}):
# check array index out of bound
if index < 0 or index > len(servers):
raise ValueError(
"Invalid index {} when selecting the host settings. Must be less than {}"
"Invalid index {} when selecting the host settings. Must be less than {}" # noqa: E501
.format(index, len(servers)))

server = servers[index]
Expand All @@ -331,7 +331,7 @@ def get_host_from_settings(self, index, variables={}):
variables[variable_name])
else:
raise ValueError(
"The variable `{}` in the host URL has invalid value {}. Must be {}."
"The variable `{}` in the host URL has invalid value {}. Must be {}." # noqa: E501
.format(
variable_name, variables[variable_name],
server['variables'][variable_name]['enum_values']))
Expand Down