Update hacking, fix errors/warnings
This version of hacking doesn't understand f-strings as usable in Python 3. Update to the latest and fix current issues, which are all just formatting fixes. Change-Id: I0a7d6f93f07477b6dd29ab143130dd9064c250be
This commit is contained in:
parent
abc91b7ced
commit
4f6629021e
@ -72,7 +72,7 @@ def main():
|
||||
bug = launchpad.bugs[bugid]
|
||||
bug.newMessage(subject=args.subject, content=args.content)
|
||||
print(" done.")
|
||||
except lazr.restfulclient.errors.ServerError as e:
|
||||
except lazr.restfulclient.errors.ServerError:
|
||||
print(" TIMEOUT during save !")
|
||||
except Exception as e:
|
||||
print(" ERROR during save ! (%s)" % e)
|
||||
|
@ -43,7 +43,7 @@ CLOSED_SERIES = set([
|
||||
'newton',
|
||||
])
|
||||
|
||||
PRE_RELEASE_RE = re.compile('''
|
||||
PRE_RELEASE_RE = re.compile(r'''
|
||||
\.(\d+(?:[ab]|rc)+\d*)$
|
||||
''', flags=re.VERBOSE | re.UNICODE)
|
||||
|
||||
@ -61,8 +61,8 @@ def find_modified_deliverable_files(reporoot):
|
||||
filenames = [
|
||||
l.strip()
|
||||
for l in results.splitlines()
|
||||
if (l.startswith('deliverables/') and
|
||||
not l.endswith('series_status.yaml'))
|
||||
if (l.startswith('deliverables/')
|
||||
and not l.endswith('series_status.yaml'))
|
||||
]
|
||||
return filenames
|
||||
|
||||
@ -178,8 +178,8 @@ def process_release_requests(reporoot, filenames, meta_data):
|
||||
if not PRE_RELEASE_RE.search(r['version'])
|
||||
]
|
||||
first_full_release = 'yes' if (
|
||||
final_versions and
|
||||
this_version['version'] == final_versions[0]
|
||||
final_versions
|
||||
and this_version['version'] == final_versions[0]
|
||||
) else 'no'
|
||||
diff_start = this_version.get('diff-start', '-')
|
||||
|
||||
|
@ -92,8 +92,8 @@ def handle_repo(path):
|
||||
repo.git.checkout(branch)
|
||||
repo.git.reset('--hard', 'remotes/origin/' + branch)
|
||||
for files in os.listdir(path):
|
||||
if not ('zuul.yaml' in files or '.zuul.yaml' in files or
|
||||
'zuul.d' in files or '.zuul.d' in files):
|
||||
if not ('zuul.yaml' in files or '.zuul.yaml' in files
|
||||
or 'zuul.d' in files or '.zuul.d' in files):
|
||||
continue
|
||||
files = handle_branch(path)
|
||||
if files:
|
||||
|
@ -80,8 +80,8 @@ def main():
|
||||
upstream_old = p_old.get('upstream')
|
||||
else:
|
||||
upstream_old = ""
|
||||
if (upstream != upstream_old and
|
||||
'track-upstream' in p.get('options', [])):
|
||||
if (upstream != upstream_old
|
||||
and 'track-upstream' in p.get('options', [])):
|
||||
print("%s has changed" % name)
|
||||
found_errors += check_repo(upstream)
|
||||
|
||||
|
@ -168,5 +168,6 @@ def main():
|
||||
a.connect(args.server, int(args.port), mynick)
|
||||
a.start()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@ -61,8 +61,8 @@ while not done:
|
||||
r = requests.get(url, params=params)
|
||||
changes = json.loads(r.text[4:])
|
||||
for change in changes:
|
||||
if (not change.get('labels') or
|
||||
not change.get('labels').get('Verified')):
|
||||
if (not change.get('labels') or not
|
||||
change.get('labels').get('Verified')):
|
||||
continue
|
||||
for key, value in change['labels']['Verified'].items():
|
||||
if key == 'value':
|
||||
|
@ -22,7 +22,7 @@ import yaml
|
||||
|
||||
|
||||
# from :
|
||||
# http://stackoverflow.com/questions/8640959/how-can-i-control-what-scalar-form-pyyaml-uses-for-my-data # flake8: noqa
|
||||
# http://stackoverflow.com/questions/8640959/how-can-i-control-what-scalar-form-pyyaml-uses-for-my-data # noqa: E501
|
||||
def should_use_block(value):
|
||||
for c in u"\u000a\u000d\u001c\u001d\u001e\u0085\u2028\u2029":
|
||||
if c in value:
|
||||
@ -42,6 +42,7 @@ def my_represent_scalar(self, tag, value, style=None):
|
||||
self.represented_objects[self.alias_key] = node
|
||||
return node
|
||||
|
||||
|
||||
def project_representer(dumper, data):
|
||||
return dumper.represent_mapping('tag:yaml.org,2002:map',
|
||||
data.items())
|
||||
@ -150,7 +151,6 @@ def has_single_key(var):
|
||||
return True
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
subprocess.run(['git', 'checkout', '--', 'zuul.d/projects.yaml'])
|
||||
yaml = ruamel.yaml.YAML()
|
||||
@ -185,5 +185,6 @@ def main():
|
||||
main_out.write('\n')
|
||||
main_out.write(line[2:])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
@ -71,5 +71,6 @@ def main():
|
||||
print("No errors found in channel setup!")
|
||||
return errors
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
|
@ -91,7 +91,7 @@ else:
|
||||
aclfd = open(aclfile)
|
||||
for line in aclfd:
|
||||
# condense whitespace to single spaces and get rid of leading/trailing
|
||||
line = re.sub('\s+', ' ', line).strip()
|
||||
line = re.sub(r'\s+', ' ', line).strip()
|
||||
# skip empty lines
|
||||
if not line:
|
||||
continue
|
||||
@ -128,8 +128,8 @@ if '3' in transformations:
|
||||
|
||||
if '4' in transformations:
|
||||
for section in acl.keys():
|
||||
acl[section] = [x for x in acl[section] if x !=
|
||||
'owner = group Administrators']
|
||||
acl[section] = [x for x in acl[section]
|
||||
if x != 'owner = group Administrators']
|
||||
|
||||
if '5' in transformations:
|
||||
for section in acl.keys():
|
||||
|
@ -30,5 +30,6 @@ def main():
|
||||
|
||||
yaml.dump(chandata, stream=sys.stdout)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
@ -23,12 +23,13 @@ def main():
|
||||
data = yaml.load(open('gerrit/projects.yaml'))
|
||||
|
||||
for project in data:
|
||||
if ('upstream' in project and
|
||||
'track-upstream' not in project.get('options', [])):
|
||||
if ('upstream' in project
|
||||
and 'track-upstream' not in project.get('options', [])):
|
||||
del project['upstream']
|
||||
|
||||
with open('gerrit/projects.yaml', 'w') as out:
|
||||
yaml.dump(data, stream=out)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user