update: the history of the package is CHANGELOG.md, from which the build writes debian/changelog, the build, publish and development scripts are in Python, and the development tools keep their settings and credentials in .lm-dev-config.
Release / release (push) Failing after 14m43s
Release / release (push) Failing after 14m43s
This commit is contained in:
1 parent
a7bfabcb89
commit
6911d16fa3
26 files changed
+1966
-2105
No files matched your search
@@ -9,22 +9,23 @@ VM; lm-dev-otp-code.py prints the user's codes.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
|
||||
from lm_dev import PROJECT, enrol_otp, totp_key
|
||||
from lm_dev import PROJECT, MissingSetting, enrol_otp, setting, totp_key
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
|
||||
parser.add_argument('--remote', default=os.environ.get('LXD_REMOTE'), help='the lxc remote (LXD_REMOTE)')
|
||||
parser.add_argument('--project', default=os.environ.get('LXD_PROJECT', PROJECT),
|
||||
parser.add_argument('--remote', help='the lxc remote (LXD_REMOTE)')
|
||||
parser.add_argument('--project', default=setting('LXD_PROJECT', PROJECT),
|
||||
help=f'the project of the VM (LXD_PROJECT, default {PROJECT})')
|
||||
parser.add_argument('--vm', default='lm-dev', help='the name of the VM (default lm-dev)')
|
||||
parser.add_argument('--user', default='admin', help='the user to enrol (default admin)')
|
||||
args = parser.parse_args()
|
||||
if not args.remote:
|
||||
parser.error('--remote or LXD_REMOTE is required')
|
||||
try:
|
||||
args.remote = args.remote or setting('LXD_REMOTE')
|
||||
except MissingSetting as missing:
|
||||
parser.error(f'--remote or {missing}')
|
||||
problem = enrol_otp(args.remote, args.project, args.vm, args.user)
|
||||
if problem:
|
||||
sys.exit(problem)
|
||||
|
||||
Reference in new issue
Block a user