mirror of
https://github.com/ceph/ceph
synced 2025-01-20 18:21:57 +00:00
Move teuthology-updatekeys' arg parsing to scripts/
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
This commit is contained in:
parent
84b2e55b93
commit
755ac2f129
40
scripts/updatekeys.py
Normal file
40
scripts/updatekeys.py
Normal file
@ -0,0 +1,40 @@
|
||||
import argparse
|
||||
|
||||
import teuthology.lock
|
||||
|
||||
|
||||
def main():
|
||||
teuthology.lock.updatekeys(parse_args())
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(description="""
|
||||
Update any hostkeys that have changed. You can list specific machines
|
||||
to run on, or use -a to check all of them automatically.
|
||||
""")
|
||||
parser.add_argument(
|
||||
'-t', '--targets',
|
||||
default=None,
|
||||
help='input yaml containing targets to check',
|
||||
)
|
||||
parser.add_argument(
|
||||
'machines',
|
||||
metavar='MACHINES',
|
||||
default=[],
|
||||
nargs='*',
|
||||
help='hosts to check for updated keys',
|
||||
)
|
||||
parser.add_argument(
|
||||
'-v', '--verbose',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='be more verbose',
|
||||
)
|
||||
parser.add_argument(
|
||||
'-a', '--all',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='update hostkeys of all machines in the db',
|
||||
)
|
||||
|
||||
return parser.parse_args()
|
2
setup.py
2
setup.py
@ -23,7 +23,7 @@ setup(
|
||||
'teuthology-worker = scripts.worker:main',
|
||||
'teuthology-lock = scripts.lock:main',
|
||||
'teuthology-schedule = scripts.schedule:main',
|
||||
'teuthology-updatekeys = teuthology.lock:update_hostkeys',
|
||||
'teuthology-updatekeys = scripts.updatekeys:main',
|
||||
'teuthology-coverage = teuthology.coverage:analyze',
|
||||
'teuthology-results = teuthology.suite:results',
|
||||
'teuthology-report = teuthology.report:main',
|
||||
|
@ -306,38 +306,7 @@ def main(ctx):
|
||||
return ret
|
||||
|
||||
|
||||
def update_hostkeys():
|
||||
parser = argparse.ArgumentParser(description="""
|
||||
Update any hostkeys that have changed. You can list specific machines
|
||||
to run on, or use -a to check all of them automatically.
|
||||
""")
|
||||
parser.add_argument(
|
||||
'-t', '--targets',
|
||||
default=None,
|
||||
help='input yaml containing targets to check',
|
||||
)
|
||||
parser.add_argument(
|
||||
'machines',
|
||||
metavar='MACHINES',
|
||||
default=[],
|
||||
nargs='*',
|
||||
help='hosts to check for updated keys',
|
||||
)
|
||||
parser.add_argument(
|
||||
'-v', '--verbose',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='be more verbose',
|
||||
)
|
||||
parser.add_argument(
|
||||
'-a', '--all',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='update hostkeys of all machines in the db',
|
||||
)
|
||||
|
||||
ctx = parser.parse_args()
|
||||
|
||||
def updatekeys(ctx):
|
||||
loglevel = logging.INFO
|
||||
if ctx.verbose:
|
||||
loglevel = logging.DEBUG
|
||||
|
Loading…
Reference in New Issue
Block a user