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:
parent
9d1d8050ab
commit
3b6ac0b042
@ -23,7 +23,7 @@ from openstack_election import utils
|
|||||||
|
|
||||||
|
|
||||||
def change_owners_options_proxy(after, before, ref, outdir='./', sieve=None,
|
def change_owners_options_proxy(after, before, ref, outdir='./', sieve=None,
|
||||||
no_extra_atcs=False):
|
no_extra_acs=False):
|
||||||
options = argparse.Namespace()
|
options = argparse.Namespace()
|
||||||
|
|
||||||
options.config = None
|
options.config = None
|
||||||
@ -34,7 +34,7 @@ def change_owners_options_proxy(after, before, ref, outdir='./', sieve=None,
|
|||||||
options.outdir = outdir
|
options.outdir = outdir
|
||||||
options.ref = ref
|
options.ref = ref
|
||||||
|
|
||||||
options.no_extra_atcs = no_extra_atcs
|
options.no_extra_acs = no_extra_acs
|
||||||
options.sieve = sieve
|
options.sieve = sieve
|
||||||
options.legacy = None
|
options.legacy = None
|
||||||
options.projects = None
|
options.projects = None
|
||||||
@ -91,7 +91,7 @@ def main():
|
|||||||
# owners.main() potentially mutates options so create a fresh one
|
# owners.main() potentially mutates options so create a fresh one
|
||||||
options = change_owners_options_proxy(args.after, args.before,
|
options = change_owners_options_proxy(args.after, args.before,
|
||||||
args.tag, tmp_dir,
|
args.tag, tmp_dir,
|
||||||
no_extra_atcs=True,
|
no_extra_acs=True,
|
||||||
sieve="branch:^stable/.*")
|
sieve="branch:^stable/.*")
|
||||||
owners.main(options)
|
owners.main(options)
|
||||||
print("Finished (Stable) roll generation @%s" % time.ctime())
|
print("Finished (Stable) roll generation @%s" % time.ctime())
|
||||||
|
@ -590,8 +590,9 @@ def main(options):
|
|||||||
owners[owner]['affiliations'] = []
|
owners[owner]['affiliations'] = []
|
||||||
for affiliation in affiliations:
|
for affiliation in affiliations:
|
||||||
if (not affiliation['end_date']
|
if (not affiliation['end_date']
|
||||||
or datetime.datetime.fromtmiestamp(
|
or datetime.datetime.fromtimestamp(
|
||||||
affiliation['end_date']) > after):
|
affiliation['end_date']) >
|
||||||
|
datetime.datetime.strptime(after, "%Y-%m-%d")):
|
||||||
owners[owner]['affiliations'].append(
|
owners[owner]['affiliations'].append(
|
||||||
affiliation['organization']['name'])
|
affiliation['organization']['name'])
|
||||||
invite = [owners[owner].get(
|
invite = [owners[owner].get(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user