Skip to content

Commit

Permalink
Merge pull request #22 from mlaradji/patch-2
Browse files Browse the repository at this point in the history
Add option in admin_command.py to skip prompt
  • Loading branch information
tobegit3hub committed Oct 25, 2018
2 parents 8ec0f8b + 4f984bb commit e0f2353
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion advisor_client/advisor_client/commandline/admin_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ def start_server(args):
if is_server_running() == True:
print("Server running, do not start again")
return

if args.server_start_noprompt:
choice = "y"
else:
choice = raw_input("Are you sure to run server container(Y/N): ").lower()

choice = raw_input("Are you sure to run server container(Y/N): ").lower()
if choice in ("y", "yes"):
print("Try to start the server with container")

Expand Down Expand Up @@ -146,6 +150,16 @@ def main():
type=int,
help="The port",
required=False)

server_start_parser.add_argument(
"-y",
dest="server_start_noprompt",
default=False,
action="store_const",
const=True,
help="Answer yes to the start server prompt. Useful for daemonizing the server."
)

server_start_parser.add_argument(
"--command_args",
dest="command_args",
Expand Down

0 comments on commit e0f2353

Please sign in to comment.