Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Warn user if storage file is missing #576

Merged
merged 1 commit into from
Aug 1, 2016

Conversation

pferate
Copy link
Contributor

@pferate pferate commented Jul 28, 2016

Also warn user if the given filename is a directory.

Resolves #338


from oauth2client import client


__author__ = 'jcgregorio@google.com (Joe Gregorio)'


_IS_DIR_MESSAGE = '{0}: Is a directory'

This comment was marked as spam.

This comment was marked as spam.

@pferate
Copy link
Contributor Author

pferate commented Jul 28, 2016

PR updated. I moved the directory housekeeping into the test function, similar to the sym link test. Both of those can be pulled into fixtures when we get to that point.

Also, should I submit an issue about possible removing the "no symbolic link" requirement? That way we can host any discussion there?

@theacodes
Copy link
Contributor

Also, should I submit an issue about possible removing the "no symbolic link" requirement? That way we can host any discussion there?

Sounds reasonable.


from oauth2client import client


__author__ = 'jcgregorio@google.com (Joe Gregorio)'

_SYM_LINK_MESSAGE = 'File: {0}: Is a symbolic link.'

This comment was marked as spam.

This comment was marked as spam.

@nathanielmanistaatgoogle
Copy link
Contributor

Commit message is stale, but no need to worry about updating it until we've found consensus.

@theacodes
Copy link
Contributor

Commit message is stale, but no need to worry about updating it until we've found consensus.

& we can always re-write it when we merge.

@pferate
Copy link
Contributor Author

pferate commented Jul 29, 2016

Updated PR and commit message

f = open(FILENAME, 'wb')
pickle.dump(credentials, f)
f.close()
cred_file = open(FILENAME, 'wb')

This comment was marked as spam.

This comment was marked as spam.

@pferate pferate force-pushed the file_storage branch 4 times, most recently from db4c7e1 to 2622958 Compare July 30, 2016 04:16
* Move `validate_file` to `oauth2client.util`
* Warn user if storage file is missing
* Raise an `IOError` exception if the given filename is a directory.
* Raise an `IOError` exception if the given filename is a symbolic link.
      (Previously raised `CredentialsFileSymbolicLinkError`)
* (test) Expanding single-letter variables
* (test) `assertEqual(None, <obj>)` -> `assertIsNone(<obj>)`
* (test) `assertNotEqual(None, <obj>)` -> `assertIsNotNone(<obj>)`
@nathanielmanistaatgoogle
Copy link
Contributor

I'm satisfied; @jonparrott will re-review since this has changed a bit.

@theacodes theacodes merged commit eb019c2 into googleapis:master Aug 1, 2016
@theacodes
Copy link
Contributor

Thanks, @pferate!

@pferate
Copy link
Contributor Author

pferate commented Aug 1, 2016

No problem @jonparrott!

@pferate pferate deleted the file_storage branch August 10, 2016 17:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants