Commit 54a6a872 authored by Stefan H. Holek's avatar Stefan H. Holek

Reverted r99039 and r99044. This is not what I came here for.

parent 93dc8b51
...@@ -56,23 +56,31 @@ def main(): ...@@ -56,23 +56,31 @@ def main():
for opt, arg in opts: for opt, arg in opts:
if opt in ("-d", "--dir"): if opt in ("-d", "--dir"):
skeltarget = os.path.abspath(os.path.expanduser(arg)) skeltarget = os.path.abspath(os.path.expanduser(arg))
if not skeltarget:
usage(sys.stderr, "dir must not be empty")
sys.exit(2)
if opt in ("-s", "--skelsrc"): if opt in ("-s", "--skelsrc"):
skelsrc = os.path.abspath(os.path.expanduser(arg)) skelsrc = os.path.abspath(os.path.expanduser(arg))
if not skelsrc:
usage(sys.stderr, "skelsrc must not be empty")
sys.exit(2)
if opt in ("-p", "--python"): if opt in ("-p", "--python"):
python = os.path.abspath(os.path.expanduser(arg)) python = os.path.abspath(os.path.expanduser(arg))
if not os.path.exists(python) and os.path.isfile(python):
usage(sys.stderr, "The Python interpreter does not exist.")
sys.exit(2)
if opt in ("-h", "--help"): if opt in ("-h", "--help"):
usage(sys.stdout) usage(sys.stdout)
sys.exit() sys.exit()
if opt in ("-u", "--user"): if opt in ("-u", "--user"):
if not arg:
usage(sys.stderr, "user must not be empty")
sys.exit(2)
if not ":" in arg: if not ":" in arg:
usage(sys.stderr, "user must be specified as name:password") usage(sys.stderr, "user must be specified as name:password")
sys.exit(2) sys.exit(2)
user, password = arg.split(":", 1) user, password = arg.split(":", 1)
if python is not None and not os.path.isfile(python):
usage(sys.stderr, "The Python interpreter does not exist.")
sys.exit(2)
if not skeltarget: if not skeltarget:
# interactively ask for skeltarget and initial user name/passwd. # interactively ask for skeltarget and initial user name/passwd.
# cant set custom instancehome in interactive mode, we default # cant set custom instancehome in interactive mode, we default
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment