Handle path not exists errors on Windows #43

Merged
merged 1 commit into from Nov 9, 2015

Conversation

Projects
None yet
3 participants
Owner

wallyworld commented Nov 9, 2015

On Windows, a call to os.Stat doesn't return a error satisfying os.IsNotExist when the file/path isn't there. It returns a os.PathError with a message like "GetFileAttributesEx.*: The system cannot find the (file|path) specified." So we introduce a helper function and make sure we handle both Windows and non Windows cases.

Member

jujugui commented Nov 9, 2015

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
http://ci.jujugui.org:8080//job/charmrepo/103/
Test PASSed.

Owner

howbazaar commented Nov 9, 2015

looks ok to me :shipit:

Member

jujugui commented Nov 9, 2015

Status: merge request accepted. Url: http://ci.jujugui.org:8080/job/charmrepo-merge

jujugui added a commit that referenced this pull request Nov 9, 2015

Merge pull request #43 from wallyworld/path-notexists-windows
Handle path not exists errors on Windows

On Windows, a call to os.Stat doesn't return a error satisfying os.IsNotExist when the file/path isn't there. It returns a os.PathError with a message like "GetFileAttributesEx.*: The system cannot find the (file|path) specified." So we introduce a helper function and make sure we handle both Windows and non Windows cases.

@jujugui jujugui merged commit 2974a7c into juju:v2-unstable Nov 9, 2015

1 check passed

default Merged build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment