adding password commandline option

This commit is contained in:
kevgliss 2015-09-03 14:20:51 -07:00
parent 541d5420bb
commit f3f5b9eeb3

View File

@ -263,18 +263,23 @@ class InitializeApp(Command):
Additionally a Lemur user will be created as a default user Additionally a Lemur user will be created as a default user
and be used when certificates are discovered by Lemur. and be used when certificates are discovered by Lemur.
""" """
def run(self): option_list = (
Option('-p', '--password', dest='password')
)
def run(self, password):
create() create()
user = user_service.get_by_username("lemur") user = user_service.get_by_username("lemur")
if not user: if not user:
sys.stdout.write("We need to set Lemur's password to continue!\n") if not password:
password1 = prompt_pass("Password") sys.stdout.write("We need to set Lemur's password to continue!\n")
password2 = prompt_pass("Confirm Password") password1 = prompt_pass("Password")
password2 = prompt_pass("Confirm Password")
if password1 != password2: if password1 != password2:
sys.stderr.write("[!] Passwords do not match!\n") sys.stderr.write("[!] Passwords do not match!\n")
sys.exit(1) sys.exit(1)
role = role_service.get_by_name('admin') role = role_service.get_by_name('admin')