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

manage.py deploy --oauth2 > OAuthNotAvailable > fix in boot.py #88

Open
pv-g opened this issue May 29, 2014 · 4 comments
Open

manage.py deploy --oauth2 > OAuthNotAvailable > fix in boot.py #88

pv-g opened this issue May 29, 2014 · 4 comments

Comments

@pv-g
Copy link

pv-g commented May 29, 2014

When trying : manage.py deploy --oauth2
getting error : google.appengine.tools.appcfg.OAuthNotAvailable
because GAE's oauth libs are missing in sys.path.

These needed libs are defined in GAE's wrapper_util.py :
(Class) Paths: oauth_client_extra_paths
but are not included by default by dev_appserver.fix_sys_path()

I did a hack but am not sure about the clean way to do it.
In boot.py, def setup_env(): (line 72) :

        # Then call fix_sys_path from the SDK
        # Debug here
        try:
            from dev_appserver import fix_sys_path, _PATHS, EXTRA_PATHS
            EXTRA_PATHS += _PATHS.oauth_client_extra_paths
            fix_sys_path()
        except ImportError:
            from old_dev_appserver import fix_sys_path, OAUTH_CLIENT_EXTRA_PATHS
            fix_sys_path(OAUTH_CLIENT_EXTRA_PATHS)

In old_dev_appserver.py, it was possible to add extra paths as args (c.f. def fix_sys_path(extra_extra_paths=())), but these args are not used anymore in the new dev_appserver.py.

I don't know djangoappengine's architecture, so I'm not sure of the correct place to fix this.
Anyway, I leave it to whoever can fix it the right way.

@pv-g
Copy link
Author

pv-g commented May 30, 2014

Sorry, my patch should have been :

        # Then call fix_sys_path from the SDK
        # Debug here
        try:
            from dev_appserver import fix_sys_path, _PATHS, EXTRA_PATHS
            EXTRA_PATHS += _PATHS.oauth_client_extra_paths
            fix_sys_path()
        except ImportError:
            from old_dev_appserver import fix_sys_path, OAUTH_CLIENT_EXTRA_PATHS
            fix_sys_path(extra_extra_paths=OAUTH_CLIENT_EXTRA_PATHS)

I fixed the last line.

@aburgel
Copy link
Member

aburgel commented May 30, 2014

It might be better to adjust sys.path in djangoappengine.management.commands.deploy since oauth is really only useful for deployments.

Can you create a pull request with that change?

@aburgel
Copy link
Member

aburgel commented May 31, 2014

I just tried ./manage.py deploy --oauth2 on my system and it worked without throwing any exceptions. Are you on the latest release of djangoappengine?

@asermax
Copy link

asermax commented Jul 25, 2014

I can confirm the issue and that the provided patch fixes it.
If it works for you it may be that you have the needed libraries within your path for some reason (global libraries perhaps?)

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

3 participants