Skip to content

Commit 2277a7f

Browse files
Supported ruff format
1 parent a24ef3c commit 2277a7f

20 files changed

Lines changed: 40 additions & 59 deletions

lib/jnpr/junos/console.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def open(self, *vargs, **kvargs):
196196
if self.cs_user is not None and self.cs_passwd is None:
197197
self.results["failed"] = True
198198
self.results["errmsg"] = (
199-
"ERROR: Console SSH, Password-less connection is " "not supported !!!"
199+
"ERROR: Console SSH, Password-less connection is not supported !!!"
200200
)
201201
logger.error(self.results["errmsg"])
202202
return self.results

lib/jnpr/junos/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def timeout(self, value):
226226
self._conn.timeout = int(value)
227227
except (ValueError, TypeError):
228228
raise RuntimeError(
229-
"could not convert timeout value of %s to an " "integer" % (value)
229+
"could not convert timeout value of %s to an integer" % (value)
230230
)
231231

232232
# ------------------------------------------------------------------------

lib/jnpr/junos/exception.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,8 @@ def __init__(self, exception, rpc_content):
321321

322322
def __repr__(self):
323323
if self.offending_line:
324-
return (
325-
"{}(reason: {}, \nThe offending config appears "
326-
"to be: \n{})".format(
327-
self.__class__.__name__, self.ex_msg, self.offending_line
328-
)
324+
return "{}(reason: {}, \nThe offending config appears to be: \n{})".format(
325+
self.__class__.__name__, self.ex_msg, self.offending_line
329326
)
330327
else:
331328
return "{}(reason: {})".format(self.__class__.__name__, self.ex_msg)

lib/jnpr/junos/factory/cfgtable.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,16 @@ def _validate_enum_value(field_name, value, enum_value):
195195
if isinstance(enum_value, list):
196196
if value not in enum_value:
197197
raise ValueError(
198-
"Invalid value %s assigned " "to field %s" % (value, field_name)
198+
"Invalid value %s assigned to field %s" % (value, field_name)
199199
)
200200
elif isinstance(enum_value, str):
201201
if not value == enum_value:
202202
raise ValueError(
203-
"Invalid value %s assigned " "to field %s" % (value, field_name)
203+
"Invalid value %s assigned to field %s" % (value, field_name)
204204
)
205205
else:
206206
raise TypeError(
207-
"Value of enum should " "be either a string or list of strings.\n"
207+
"Value of enum should be either a string or list of strings.\n"
208208
)
209209

210210
def _validate_type(field_name, value, opt):
@@ -234,14 +234,12 @@ def _validate_min_max_value(field_name, value, opt):
234234
if isinstance(value, (int, float)):
235235
if value < opt["minValue"] or value > opt["maxValue"]:
236236
raise ValueError(
237-
"Invalid value %s assigned "
238-
"to field %s.\n" % (value, field_name)
237+
"Invalid value %s assigned to field %s.\n" % (value, field_name)
239238
)
240239
elif isinstance(value, str):
241240
if len(value) < opt["minValue"] or len(value) > opt["maxValue"]:
242241
raise ValueError(
243-
"Invalid value %s assigned "
244-
"to field %s.\n" % (value, field_name)
242+
"Invalid value %s assigned to field %s.\n" % (value, field_name)
245243
)
246244

247245
if isinstance(value, dict):
@@ -622,7 +620,7 @@ def set(self, **kvargs):
622620
"""
623621
if self._is_field_set:
624622
raise RuntimeError(
625-
"Field value is changed, append() " "must be called before set()"
623+
"Field value is changed, append() must be called before set()"
626624
)
627625

628626
self.lock()
@@ -698,7 +696,7 @@ def load(self, **kvargs):
698696
"""
699697
if self._is_field_set:
700698
raise RuntimeError(
701-
"Field value is changed, append() " "must be called before load()"
699+
"Field value is changed, append() must be called before load()"
702700
)
703701

704702
# pass up to config class load() api, with xml object as vargs[0].

lib/jnpr/junos/factory/cmdtable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ def _filter_output(self, cli_table):
388388
cli_table_size = cli_table.size
389389
if cli_table_size > 1:
390390
raise KeyError(
391-
"Key is Mandatory for parsed o/p of %s " "length" % cli_table_size
391+
"Key is Mandatory for parsed o/p of %s length" % cli_table_size
392392
)
393393
elif cli_table_size == 1:
394394
temp_dict = self._parse_row(cli_table[1], cli_table, reverse_fields)

lib/jnpr/junos/factory/factory_cls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def FactoryCMDTable(
6363
eval=None,
6464
platform="juniper_junos",
6565
use_textfsm=False,
66-
**kwargs
66+
**kwargs,
6767
):
6868
new_cls = type(table_name, (CMDTable,), {})
6969
new_cls.GET_CMD = cmd

lib/jnpr/junos/factory/optable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def get(self, *vargs, **kvargs):
6767
filter_xml = generate_sax_parser_input(self)
6868
rpc_args["filter_xml"] = filter_xml
6969
except Exception as ex:
70-
logger.debug("Not able to create SAX parser input due to " "'%s'" % ex)
70+
logger.debug("Not able to create SAX parser input due to '%s'" % ex)
7171
self.D.transform = lambda: remove_namespaces_and_spaces
7272

7373
self.D.transform = lambda: remove_namespaces_and_spaces

lib/jnpr/junos/factory/state_machine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def _parse_item_iter(self, lines):
283283
else [self._table.KEY]
284284
):
285285
raise KeyError(
286-
"Table with grouped item must contain " "corresponding key(s)"
286+
"Table with grouped item must contain corresponding key(s)"
287287
)
288288
master_key = groups[0] if len(groups) == 1 else tuple(groups)
289289
self._data[master_key] = {}

lib/jnpr/junos/facts/current_re.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def get_facts(device):
102102
current_re_sw = device.rpc.get_software_information()
103103
if current_re_sw is not None:
104104
server_slot = current_re_sw.findtext(
105-
'./package-information[name="Server ' 'slot"]/comment'
105+
'./package-information[name="Server slot"]/comment'
106106
)
107107
slot_num = re.findall(r"Server slot : (\d+)", server_slot)[0]
108108
current_re = ["server" + slot_num]

lib/jnpr/junos/facts/file_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def provides_facts():
44
of each key is the doc string describing the fact.
55
"""
66
return {
7-
"HOME": "A string indicating the home directory of the current " "user.",
7+
"HOME": "A string indicating the home directory of the current user.",
88
}
99

1010

0 commit comments

Comments
 (0)