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

~ in volume path #301

Closed
dmitrig01 opened this issue Jul 9, 2014 · 7 comments · Fixed by #442
Closed

~ in volume path #301

dmitrig01 opened this issue Jul 9, 2014 · 7 comments · Fixed by #442

Comments

@dmitrig01
Copy link

If I try to mount something relative to my home folder, instead it creates a folder called "~" inside the current folder, and uses that.

@aanand
Copy link

aanand commented Jul 9, 2014

Fun! Probably need an os.expanduser() in there.

PR welcome 😄

@d11wtq
Copy link

d11wtq commented Jul 15, 2014

Tricky one to write tests for ;) Unless you can set $HOME in the tests and it will use it.

@aanand
Copy link

aanand commented Jul 15, 2014

I believe it will. From the docs for os.path.expanduser:

On Unix, an initial ~ is replaced by the environment variable HOME if it is set; otherwise the current user’s home directory is looked up in the password directory through the built-in module pwd. An initial ~user is looked up directly in the password directory.

So presumably, if os.environ['HOME'] is assigned to, expanduser will pick it up.

@aanand
Copy link

aanand commented Jul 15, 2014

Yep!

>>> import os
>>> os.environ['HOME']
'/Users/aanand'
>>> os.environ['HOME'] = '/somewhere/else'
>>> os.path.expanduser('~/Desktop')
'/somewhere/else/Desktop'

@d11wtq
Copy link

d11wtq commented Jul 16, 2014

😄 🍰

@dsyer
Copy link

dsyer commented Aug 13, 2014

Please, someone fix this soon.

@hugochinchilla
Copy link

+1

dnephin added a commit to dnephin/compose that referenced this issue Aug 26, 2014
Adds ~ support and ro mode support for volumes, along with some additional validation.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
dnephin added a commit to dnephin/compose that referenced this issue Aug 26, 2014
Adds ~ support and ro mode support for volumes, along with some additional validation.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
dnephin added a commit to dnephin/compose that referenced this issue Aug 28, 2014
Adds ~ support and ro mode support for volumes, along with some additional validation.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
dnephin added a commit to dnephin/compose that referenced this issue Aug 31, 2014
Adds ~ support and ro mode support for volumes, along with some additional validation.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this issue Apr 10, 2015
Adds ~ support and ro mode support for volumes, along with some additional validation.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>

Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
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

Successfully merging a pull request may close this issue.

5 participants