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

Display help and usage message #3

Closed
rhvgoyal opened this issue Jul 31, 2015 · 7 comments
Closed

Display help and usage message #3

rhvgoyal opened this issue Jul 31, 2015 · 7 comments

Comments

@rhvgoyal
Copy link

If I type docker-migrate.py, I get following. I should instead get a help message with various options.

./docker-migrate.py

Traceback (most recent call last):
File "./docker-migrate.py", line 8, in
if sys.argv[1] == "export" :
IndexError: list index out of range

@rhvgoyal
Copy link
Author

Also export command did not work for me.

./docker-migrate.py export /tmp/export/

Saving image docker.io/ubuntu:latest
/bin/sh: /tmp/export//images/docker.io/ubuntu-latest.tar: No such file or directory
Saving image docker.io/fedora:latest
/bin/sh: /tmp/export//images/docker.io/fedora-latest.tar: No such file or directory
Saving image docker.io/busybox:latest
/bin/sh: /tmp/export//images/docker.io/busybox-latest.tar: No such file or directory

@jramseye
Copy link
Owner

jramseye commented Aug 3, 2015

Hi!

I've pushed a fixed version. It fixes the help message problem. I tried to replicate your export bug on my computer, but it worked fine. Did it create the export directory on your computer?

@rhvgoyal
Copy link
Author

rhvgoyal commented Aug 4, 2015

If I just type ./docker-migrate.py (and no parameters), then export issue still happens for me.

I think reason is that you are assuming that arguments have been passed and trying to access sys.argv[1]. But it is not there.

I think instead look for number of arguments and if minimum number of arguments are not there, then display help message.

@rhvgoyal
Copy link
Author

rhvgoyal commented Aug 4, 2015

I can still reproduce the "No Such file or Directory Issue".

[root@vm2-f22 rhvgoyal-docker-migrate]# ./docker-migrate export /tmp/image-export/
-bash: ./docker-migrate: No such file or directory
[root@vm2-f22 rhvgoyal-docker-migrate]# ./docker-migrate.py export /tmp/image-export/
Saving image docker.io/fedora:latest
/bin/sh: /tmp/image-export//images/docker.io/fedora-latest.tar: No such file or directory
Saving image docker.io/busybox:latest
/bin/sh: /tmp/image-export//images/docker.io/busybox-latest.tar: No such file or directory

I think problem here is the image name. It contains a "/". I think you will have to replace "/" with "-" or something like that. If you use "/" in file name, then it is treated as path in directory and "docker-io" directory is not present.

@jramseye
Copy link
Owner

jramseye commented Aug 4, 2015

You're right! Whoops, I thought I had fixed it, but I guess I missed a spot. Pushed my new fix; I think this one should work.

----- Original Message -----
From: "Vivek Goyal" notifications@github.com
To: "jramseye/docker-migrate" docker-migrate@noreply.github.com
Cc: "jramseye" jramseye@redhat.com
Sent: Tuesday, August 4, 2015 8:03:38 AM
Subject: Re: [docker-migrate] Display help and usage message (#3)

If I just type ./docker-migrate.py (and no parameters), then export issue still happens for me.

I think reason is that you are assuming that arguments have been passed and trying to access sys.argv[1]. But it is not there.

I think instead look for number of arguments and if minimum number of arguments are not there, then display help message.


Reply to this email directly or view it on GitHub:
#3 (comment)

@jramseye
Copy link
Owner

jramseye commented Aug 4, 2015

Are you running it as ./docker-migrate? I have to run it as ./docker-migrate.py Do we want it to work either way?

You're right. That is a bug. I'll go take a look at it. Thanks for catching it!

----- Original Message -----
From: "Vivek Goyal" notifications@github.com
To: "jramseye/docker-migrate" docker-migrate@noreply.github.com
Cc: "jramseye" jramseye@redhat.com
Sent: Tuesday, August 4, 2015 8:17:04 AM
Subject: Re: [docker-migrate] Display help and usage message (#3)

I can still reproduce the "No Such file or Directory Issue".

[root@vm2-f22 rhvgoyal-docker-migrate]# ./docker-migrate export /tmp/image-export/
-bash: ./docker-migrate: No such file or directory
[root@vm2-f22 rhvgoyal-docker-migrate]# ./docker-migrate.py export /tmp/image-export/
Saving image docker.io/fedora:latest
/bin/sh: /tmp/image-export//images/docker.io/fedora-latest.tar: No such file or directory
Saving image docker.io/busybox:latest
/bin/sh: /tmp/image-export//images/docker.io/busybox-latest.tar: No such file or directory

I think problem here is the image name. It contains a "/". I think you will have to replace "/" with "-" or something like that. If you use "/" in file name, then it is treated as path in directory and "docker-io" directory is not present.


Reply to this email directly or view it on GitHub:
#3 (comment)

@jramseye
Copy link
Owner

jramseye commented Aug 4, 2015

Hi! I've fixed it now. I replace / with ~ (we already use - to separate tags from image names). If you can think of any other characters we'll need to parse out, please let me know! It doesn't seem to change the final image name when we reimport, which is good. I've pushed my fix.

----- Original Message -----
From: "Vivek Goyal" notifications@github.com
To: "jramseye/docker-migrate" docker-migrate@noreply.github.com
Cc: "jramseye" jramseye@redhat.com
Sent: Tuesday, August 4, 2015 8:17:04 AM
Subject: Re: [docker-migrate] Display help and usage message (#3)

I can still reproduce the "No Such file or Directory Issue".

[root@vm2-f22 rhvgoyal-docker-migrate]# ./docker-migrate export /tmp/image-export/
-bash: ./docker-migrate: No such file or directory
[root@vm2-f22 rhvgoyal-docker-migrate]# ./docker-migrate.py export /tmp/image-export/
Saving image docker.io/fedora:latest
/bin/sh: /tmp/image-export//images/docker.io/fedora-latest.tar: No such file or directory
Saving image docker.io/busybox:latest
/bin/sh: /tmp/image-export//images/docker.io/busybox-latest.tar: No such file or directory

I think problem here is the image name. It contains a "/". I think you will have to replace "/" with "-" or something like that. If you use "/" in file name, then it is treated as path in directory and "docker-io" directory is not present.


Reply to this email directly or view it on GitHub:
#3 (comment)

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

2 participants