Fix minor election tool bugs

1. no_extra_atcs in generate_rolls needs to change to no_extra_acs
 - https://paste.opendev.org/show/b3sU4uxlP6yHYPdFFOy6/
2. fromtmiestamp -> fromtimestamp
 - https://paste.opendev.org/show/bpROEF1BBGFyT9guRSoa/
3. datetime and string comparison error
 - https://paste.opendev.org/show/bgqWqfvxo3pDQKxKbdkc/

Change-Id: Ia50e466354f510cb86243a2e29d179d7b7dae395
This commit is contained in:
Ian Y. Choi 2024-02-29 12:47:24 +09:00
parent 9d1d8050ab
commit 3b6ac0b042
2 changed files with 6 additions and 5 deletions

View File

@ -23,7 +23,7 @@ from openstack_election import utils
def change_owners_options_proxy(after, before, ref, outdir='./', sieve=None,
no_extra_atcs=False):
no_extra_acs=False):
options = argparse.Namespace()
options.config = None
@ -34,7 +34,7 @@ def change_owners_options_proxy(after, before, ref, outdir='./', sieve=None,
options.outdir = outdir
options.ref = ref
options.no_extra_atcs = no_extra_atcs
options.no_extra_acs = no_extra_acs
options.sieve = sieve
options.legacy = None
options.projects = None
@ -91,7 +91,7 @@ def main():
# owners.main() potentially mutates options so create a fresh one
options = change_owners_options_proxy(args.after, args.before,
args.tag, tmp_dir,
no_extra_atcs=True,
no_extra_acs=True,
sieve="branch:^stable/.*")
owners.main(options)
print("Finished (Stable) roll generation @%s" % time.ctime())

View File

@ -590,8 +590,9 @@ def main(options):
owners[owner]['affiliations'] = []
for affiliation in affiliations:
if (not affiliation['end_date']
or datetime.datetime.fromtmiestamp(
affiliation['end_date']) > after):
or datetime.datetime.fromtimestamp(
affiliation['end_date']) >
datetime.datetime.strptime(after, "%Y-%m-%d")):
owners[owner]['affiliations'].append(
affiliation['organization']['name'])
invite = [owners[owner].get(