248 NodeMetadataProxy(self, self.get_node(node_name))
249 return self._node_metadata_proxies[node_name]
250
251 def _build_node_metadata(self, initial_node_name):252 self.__iterations = 0
253
254 while True:
365 mode = '0' + self.attributes['mode'].zfill(4)
366 self.run(command.format(mode, quote(self.name)))
367
368 def _fix_owner(self, status):369 group = self.attributes['group'] or ""
370 if group:
371 group = ":" + quote(group)
353 may_fail=True,
354 )
355
356 def _fix_mode(self, status):357 if self.node.os in self.node.OS_FAMILY_BSD:
358 command = "chmod {} {}"
359 mode = self.attributes['mode']
338 continue
339 getattr(self, "_fix_" + fix_type)(status)
340
341 def _fix_content_hash(self, status):342 with self._write_local_file() as local_path:
343 with io.job(_("{} {} uploading to node").format(
344 bold(self.node.name),
55 elif 'owner' in status.keys_to_fix or 'group' in status.keys_to_fix:
56 self._fix_ownership(status)
57
58 def _fix_ownership(self, status): 59 group = self.attributes['group'] or ""
60 if group:
61 group = ":" + quote(group)
An unused argument can lead to confusions. It should be removed. If this variable is necessary, name the variable _
or start the name with unused
or _unused
.
def square(x, y=1):
return x * x
class MySubClass(MyClass):
def __init__(self, number):
self.value = 42 # argument `number` remains unused
def square(x):
return x * x
class MySubClass(MyClass):
def __init__(self, _):
self.value = 42