Skip to content

Commit

Permalink
Globally disabled bad-continuation symbol.
Browse files Browse the repository at this point in the history
  • Loading branch information
keclar committed Aug 20, 2020
1 parent 1be16b5 commit d663700
Show file tree
Hide file tree
Showing 20 changed files with 72 additions and 72 deletions.
4 changes: 2 additions & 2 deletions 2.7.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# anomalous-backslash-in-string<W1401>: (hi-pri) Used when a backslash is in a literal string but not as an escape.
# arguments-differ<W0221>: (hi-pri) Used when a method has a different number of arguments than in the implemented interface or in an overridden method.
# attribute-defined-outside-init<W0201>: (hi-pri) Used when an instance attribute is defined outside the __init__ method.
# bad-continuation<C0330>: (needs review) **REMOVED in pylint-2.6.0**
# bad-indentation<W0311>: (hi-pri) Used when an unexpected number of indentation's tabulations or spaces has been found.
# bad-open-mode<W1501>: (hi-pri) Python supports: r, w, a[, x] modes with b, +, and U (only with r) options.
# bad-super-call<E1003>: (hi-pri) Used when another argument than the current class is given as first argument of the super builtin.
Expand Down Expand Up @@ -89,7 +88,8 @@

[MESSAGES CONTROL]

disable=bad-option-value, # pylint does not recognize the error code/symbol (needed to supress breaking changes across pylint versions)
disable=bad-continuation, # Buggy, **REMOVED in pylint-2.6.0**
bad-option-value, # pylint does not recognize the error code/symbol (needed to supress breaking changes across pylint versions)
bad-whitespace, # Used when a wrong number of spaces is used around an operator, bracket or block opener.
broad-except, # Used when an except catches a too general exception, possibly burying unrelated errors.
consider-iterating-dictionary, # Emitted when the keys of a dictionary are iterated through the .keys() method.
Expand Down
4 changes: 2 additions & 2 deletions 3.6.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# assignment-from-no-return<E1111>: (hi-pri) Used when an assignment is done on a function call but the inferred function doesn't return anything.
# assignment-from-none<E1128>: (hi-pri) Used when an assignment is done on a function call but the inferred function returns nothing but None.
# attribute-defined-outside-init<W0201>: (hi-pri) Used when an instance attribute is defined outside the __init__ method.
# bad-continuation<C0330>: (needs review) **REMOVED in pylint-2.6.0**
# bad-indentation<W0311>: (hi-pri) Used when an unexpected number of indentation's tabulations or spaces has been found.
# bad-open-mode<W1501>: (hi-pri) Python supports: r, w, a[, x] modes with b, +, and U (only with r) options.
# bad-super-call<E1003>: (hi-pri) Used when another argument than the current class is given as first argument of the super builtin.
Expand Down Expand Up @@ -86,7 +85,8 @@

[MESSAGES CONTROL]

disable=bad-whitespace, # Used when a wrong number of spaces is used around an operator, bracket or block opener. **REMOVED IN pylint-2.6.0**
disable=bad-continuation, # Buggy, **REMOVED in pylint-2.6.0**
bad-whitespace, # Used when a wrong number of spaces is used around an operator, bracket or block opener. **REMOVED IN pylint-2.6.0**
broad-except, # Used when an except catches a too general exception, possibly burying unrelated errors.
consider-iterating-dictionary, # Emitted when the keys of a dictionary are iterated through the .keys() method.
consider-using-dict-comprehension, # Although there is nothing syntactically wrong with this code, it is hard to read and can be simplified to a dict comprehension.
Expand Down
4 changes: 2 additions & 2 deletions azurelinuxagent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def parse_args(sys_args): # pylint: disable=R0912
conf_file_path = m.group(1)
if not os.path.exists(conf_file_path):
print("Error: Configuration file {0} does not exist".format(
conf_file_path), file=sys.stderr) # pylint: disable=C0330
conf_file_path), file=sys.stderr)
usage()
sys.exit(1)

Expand Down Expand Up @@ -256,7 +256,7 @@ def usage():
"""
s = "\n" # pylint: disable=C0103
s += ("usage: {0} [-verbose] [-force] [-help] " # pylint: disable=C0103
"-configuration-path:<path to configuration file>" # pylint: disable=C0330
"-configuration-path:<path to configuration file>"
"-deprovision[+user]|-register-service|-version|-daemon|-start|"
"-run-exthandlers|-show-configuration]"
"").format(sys.argv[0])
Expand Down
12 changes: 6 additions & 6 deletions azurelinuxagent/common/cgroupapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ def cgroup_path(tail=""):
if not os.path.exists(path):
fileutil.mkdir(path)
osutil.mount(device='cgroup_root',
mount_point=path, # pylint: disable=C0330
option="-t tmpfs", # pylint: disable=C0330
chk_err=False) # pylint: disable=C0330
mount_point=path,
option="-t tmpfs",
chk_err=False)
elif not os.path.isdir(cgroup_path()):
logger.error("Could not mount cgroups: ordinary file at {0}", path)
return
Expand All @@ -241,9 +241,9 @@ def cgroup_path(tail=""):
if not os.path.exists(target_path):
fileutil.mkdir(target_path)
osutil.mount(device=controller,
mount_point=target_path, # pylint: disable=C0330
option="-t cgroup -o {0}".format(controller), # pylint: disable=C0330
chk_err=False) # pylint: disable=C0330
mount_point=target_path,
option="-t cgroup -o {0}".format(controller),
chk_err=False)
if controller == 'cpu,cpuacct':
cpu_mounted = True
except Exception as exception:
Expand Down
16 changes: 8 additions & 8 deletions azurelinuxagent/common/cgroupconfigurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,14 @@ def start_extension_command(self, extension_name, command, timeout, shell, cwd,
error_code=error_code)
else:
process_output = self._cgroups_api.start_extension_command(extension_name,
command, # pylint: disable=C0330
timeout, # pylint: disable=C0330
shell=shell, # pylint: disable=C0330
cwd=cwd, # pylint: disable=C0330
env=env, # pylint: disable=C0330
stdout=stdout, # pylint: disable=C0330
stderr=stderr, # pylint: disable=C0330
error_code=error_code) # pylint: disable=C0330
command,
timeout,
shell=shell,
cwd=cwd,
env=env,
stdout=stdout,
stderr=stderr,
error_code=error_code)

return process_output

Expand Down
4 changes: 2 additions & 2 deletions azurelinuxagent/common/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,12 @@ def get_ssh_key_glob(conf=__conf__):

def get_ssh_key_private_path(conf=__conf__):
return os.path.join(get_ssh_dir(conf),
'ssh_host_{0}_key'.format(get_ssh_host_keypair_type(conf))) # pylint: disable=C0330
'ssh_host_{0}_key'.format(get_ssh_host_keypair_type(conf)))


def get_ssh_key_public_path(conf=__conf__):
return os.path.join(get_ssh_dir(conf),
'ssh_host_{0}_key.pub'.format(get_ssh_host_keypair_type(conf))) # pylint: disable=C0330
'ssh_host_{0}_key.pub'.format(get_ssh_host_keypair_type(conf)))


def get_root_device_scsi_timeout(conf=__conf__):
Expand Down
2 changes: 1 addition & 1 deletion azurelinuxagent/common/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ def add_common_event_parameters(self, event, event_timestamp):
# Currently only the GuestAgentExtensionEvents has these columns, the other tables dont have them so skipping
# this data in those tables.
common_params.extend([TelemetryEventParam(GuestAgentExtensionEventsSchema.ExtensionType, event.file_type),
TelemetryEventParam(GuestAgentExtensionEventsSchema.IsInternal, False)]) # pylint: disable=C0330
TelemetryEventParam(GuestAgentExtensionEventsSchema.IsInternal, False)])

event.parameters.extend(common_params)
event.parameters.extend(self._common_parameters)
Expand Down
12 changes: 6 additions & 6 deletions azurelinuxagent/common/osutil/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,11 @@ def _correct_instance_id(id): # pylint: disable=W0622,C0103

parts = id.split('-')
return '-'.join([
textutil.swap_hexstring(parts[0], width=2), # pylint: disable=C0330
textutil.swap_hexstring(parts[1], width=2), # pylint: disable=C0330
textutil.swap_hexstring(parts[2], width=2), # pylint: disable=C0330
parts[3], # pylint: disable=C0330
parts[4] # pylint: disable=C0330
textutil.swap_hexstring(parts[0], width=2),
textutil.swap_hexstring(parts[1], width=2),
textutil.swap_hexstring(parts[2], width=2),
parts[3],
parts[4]
])

def is_current_instance_id(self, id_that):
Expand Down Expand Up @@ -821,7 +821,7 @@ def _build_route_list(proc_net_route): # pylint: disable=R0914
route = entry.split("\t")
if len(route) > 0: # pylint: disable=len-as-condition
route_obj = RouteEntry(route[idx_iface], route[idx_dest], route[idx_gw], route[idx_mask],
route[idx_flags], route[idx_metric]) # pylint: disable=C0330
route[idx_flags], route[idx_metric])
route_list.append(route_obj)
return route_list

Expand Down
2 changes: 1 addition & 1 deletion azurelinuxagent/common/osutil/nsbsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def deploy_ssh_pubkey(self, username, pubkey):

#overide parameters
super(NSBSDOSUtil, self).deploy_ssh_pubkey('admin',
["/usr/Firewall/.ssh/authorized_keys", thumbprint, value]) # pylint: disable=C0330
["/usr/Firewall/.ssh/authorized_keys", thumbprint, value])

def del_root_password(self):
logger.warn("Root password deletion disabled")
Expand Down
6 changes: 3 additions & 3 deletions azurelinuxagent/common/osutil/openbsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ def mount_dvd(self, # pylint: disable=R0913

for retry in range(0, max_retry):
retcode = self.mount(dvd_device,
mount_point, # pylint: disable=C0330
option="-o ro -t udf", # pylint: disable=C0330
chk_err=False) # pylint: disable=C0330
mount_point,
option="-o ro -t udf",
chk_err=False)
if retcode == 0:
logger.info("Successfully mounted DVD")
return
Expand Down
2 changes: 1 addition & 1 deletion azurelinuxagent/common/protocol/goal_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def _parse_plugin_settings(ext_handler, plugin_settings): # pylint: disable=R091
if len(settings) != len(ext_handler_plugin_settings):
msg = "ExtHandler PluginSettings Version Mismatch! Expected PluginSettings version: {0} for Handler: " \
"{1} but found versions: ({2})".format(version, name, ', '.join(
set([getattrib(x, "version") for x in ext_handler_plugin_settings]))) # pylint: disable=C0330
set([getattrib(x, "version") for x in ext_handler_plugin_settings])))
add_event(AGENT_NAME, op=WALAEventOperation.PluginSettingsVersionMismatch, message=msg, log_event=False,
is_success=False)
if len(settings) == 0: # pylint: disable=len-as-condition
Expand Down
4 changes: 2 additions & 2 deletions azurelinuxagent/common/protocol/imds.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,11 @@ def _get_metadata_from_endpoint(self, endpoint, resource_path, headers): # pylin

if resp.status >= 500:
return IMDS_INTERNAL_SERVER_ERROR, "IMDS error in /metadata/{0}: {1}".format(
resource_path, restutil.read_response_error(resp)) # pylint: disable=C0330
resource_path, restutil.read_response_error(resp))

if restutil.request_failed(resp):
return IMDS_RESPONSE_ERROR, "IMDS error in /metadata/{0}: {1}".format(
resource_path, restutil.read_response_error(resp)) # pylint: disable=C0330
resource_path, restutil.read_response_error(resp))

return IMDS_RESPONSE_SUCCESS, resp.read()

Expand Down
2 changes: 1 addition & 1 deletion azurelinuxagent/common/rdma.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def wait_rdma_device(path, timeout_sec, check_interval_sec):
def wait_any_rdma_device(dir, timeout_sec, check_interval_sec): # pylint: disable=W0622
logger.info(
"RDMA: waiting for any Infiniband device at directory={0} timeout={1}s".format(
dir, timeout_sec)) # pylint: disable=C0330
dir, timeout_sec))
total_retries = timeout_sec/check_interval_sec
n = 0 # pylint: disable=C0103
while n < total_retries:
Expand Down
8 changes: 4 additions & 4 deletions azurelinuxagent/common/utils/flexible_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ def _compile_pattern(self): # pylint: disable=R1711
tags = '|'.join(re.escape(tag) for tag in self.prerel_tags)
self.prerel_tags_set = dict(zip(self.prerel_tags, range(len(self.prerel_tags))))
release_re = '(?:{prerel_sep}(?P<{tn}>{tags})(?P<{nn}>\d*))?'.format( # pylint: disable=W1401
prerel_sep=self._re_prerel_sep, # pylint: disable=C0330
tags=tags, # pylint: disable=C0330
tn=self._nn_prerel_tag, # pylint: disable=C0330
nn=self._nn_prerel_num) # pylint: disable=C0330
prerel_sep=self._re_prerel_sep,
tags=tags,
tn=self._nn_prerel_tag,
nn=self._nn_prerel_num)
else:
release_re = ''

Expand Down
2 changes: 1 addition & 1 deletion azurelinuxagent/common/utils/networkutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def mask_quad(self):
def to_json(self):
f = '{{"Iface": "{0}", "Destination": "{1}", "Gateway": "{2}", "Mask": "{3}", "Flags": "{4:#06x}", "Metric": "{5}"}}' # pylint: disable=C0103
return f.format(self.interface, self.destination_quad(), self.gateway_quad(), self.mask_quad(),
self.flags, self.metric) # pylint: disable=C0330
self.flags, self.metric)

def __str__(self):
f = "Iface: {0}\tDestination: {1}\tGateway: {2}\tMask: {3}\tFlags: {4:#06x}\tMetric: {5}" # pylint: disable=C0103
Expand Down
26 changes: 13 additions & 13 deletions azurelinuxagent/common/utils/restutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,11 @@ def _http_request(method, host, rel_uri, port=None, data=None, secure=False, # p


def http_request(method, # pylint: disable=R0913,R0912,R0914,W0102
url, data, headers=None, # pylint: disable=C0330
use_proxy=False, # pylint: disable=C0330
max_retry=DEFAULT_RETRIES, # pylint: disable=C0330
retry_codes=RETRY_CODES, # pylint: disable=C0330
retry_delay=DELAY_IN_SECONDS): # pylint: disable=C0330
url, data, headers=None,
use_proxy=False,
max_retry=DEFAULT_RETRIES,
retry_codes=RETRY_CODES,
retry_delay=DELAY_IN_SECONDS):

global SECURE_WARNING_EMITTED # pylint: disable=W0603

Expand Down Expand Up @@ -382,11 +382,11 @@ def http_request(method, # pylint: disable=R0913,R0912,R0914,W0102
delay = THROTTLE_DELAY_IN_SECONDS if was_throttled else retry_delay

logger.verbose("[HTTP Retry] "
"Attempt {0} of {1} will delay {2} seconds: {3}", # pylint: disable=C0330
attempt+1, # pylint: disable=C0330
max_retry, # pylint: disable=C0330
delay, # pylint: disable=C0330
msg) # pylint: disable=C0330
"Attempt {0} of {1} will delay {2} seconds: {3}",
attempt+1,
max_retry,
delay,
msg)

time.sleep(delay)

Expand Down Expand Up @@ -546,9 +546,9 @@ def read_response_error(resp):
if resp is not None:
try:
result = "[HTTP Failed] [{0}: {1}] {2}".format(
resp.status, # pylint: disable=C0330
resp.reason, # pylint: disable=C0330
resp.read()) # pylint: disable=C0330
resp.status,
resp.reason,
resp.read())

# this result string is passed upstream to several methods
# which do a raise HttpError() or a format() of some kind;
Expand Down
8 changes: 4 additions & 4 deletions azurelinuxagent/common/utils/textutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,10 @@ def swap_hexstring(s, width=2): # pylint: disable=C0103
s = ('0' * (width - (len(s) % width))) + s

return ''.join(reversed(
re.findall( # pylint: disable=C0330
r'[a-f0-9]{{{0}}}'.format(width), # pylint: disable=C0330
s, # pylint: disable=C0330
re.IGNORECASE))) # pylint: disable=C0330
re.findall(
r'[a-f0-9]{{{0}}}'.format(width),
s,
re.IGNORECASE)))


def parse_json(json_str):
Expand Down
8 changes: 4 additions & 4 deletions azurelinuxagent/ga/exthandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1347,10 +1347,10 @@ def update_settings(self):

def create_handler_env(self):
handler_env = {
HandlerEnvironment.logFolder: self.get_log_dir(), # pylint: disable=C0330
HandlerEnvironment.configFolder: self.get_conf_dir(), # pylint: disable=C0330
HandlerEnvironment.statusFolder: self.get_status_dir(), # pylint: disable=C0330
HandlerEnvironment.heartbeatFile: self.get_heartbeat_file() # pylint: disable=C0330
HandlerEnvironment.logFolder: self.get_log_dir(),
HandlerEnvironment.configFolder: self.get_conf_dir(),
HandlerEnvironment.statusFolder: self.get_status_dir(),
HandlerEnvironment.heartbeatFile: self.get_heartbeat_file()
}

if is_extension_telemetry_pipeline_enabled():
Expand Down
Loading

0 comments on commit d663700

Please sign in to comment.