Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loco remove-user throwing an exception #1

Open
aminits opened this issue Sep 26, 2020 · 0 comments
Open

loco remove-user throwing an exception #1

aminits opened this issue Sep 26, 2020 · 0 comments

Comments

@aminits
Copy link

aminits commented Sep 26, 2020

loco remove-user throwing an exception

I get this error stack:
$ loco remove-user loco0
Traceback (most recent call last):
File "/home/ec2-user/.local/bin/loco", line 8, in
sys.exit(main())
File "/home/ec2-user/.local/lib/python3.7/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/home/ec2-user/.local/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/ec2-user/.local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/ec2-user/.local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/ec2-user/.local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/ec2-user/.local/lib/python3.7/site-packages/loco/loco.py", line 136, in remove_user
donotrun(remove_user_fn, user)
NameError: name 'donotrun' is not defined

Looks like the error comes from this function: donotrun is not defined

@main.command()
@click.argument("user", default=USER)
def remove_user(user):
""" Used to remove a loco user """
if user in os.path.expanduser("~"):
raise Exception("Cannot delete self")
if not user.startswith("loco"):
inp = input("Are you sure you want to delete user '{}' [y/N]: ".format(user))
if inp.lower() != "y":
print("Aborting.")
return
os_dependent_functions = {"Darwin": remove_user_osx, "Linux": remove_user_linux}
remove_user_fn = platform_fn(**os_dependent_functions)
donotrun(remove_user_fn, user)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant