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

Update oauth2client call #457

Merged
merged 3 commits into from
Sep 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion debian/appscale_install_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ installpylibs()
pip_wrapper oauth2client
pip_wrapper google-api-python-client
pip_wrapper argparse
pip_wrapper python-gflags
}

installappscaletools()
Expand Down
4 changes: 3 additions & 1 deletion lib/agents/gce_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""

# General-purpose Python library imports
import argparse
import datetime
import json
import os.path
Expand Down Expand Up @@ -1087,7 +1088,8 @@ def open_connection(self, parameters):
credentials = storage.get()

if credentials is None or credentials.invalid:
credentials = oauth2client.tools.run(flow, storage)
flags = oauth2client.tools.argparser.parse_args(args=[])
credentials = oauth2client.tools.run_flow(flow, storage, flags)

# Build the service
return discovery.build('compute', self.API_VERSION), credentials
Expand Down
2 changes: 1 addition & 1 deletion osx/appscale_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mkdir -p $TARGETDIR
cp -r bin lib templates LICENSE README.md $TARGETDIR || exit 1

# from installpylibs
easy_install termcolor SOAPpy pyyaml boto argparse oauth2client google-api-python-client httplib2 python-gflags
easy_install termcolor SOAPpy pyyaml boto argparse oauth2client google-api-python-client httplib2

# create ssh private key if it does not exist
test -e ~/.ssh/id_rsa || ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -N ""
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ def readme():
'PyYAML',
'boto',
'google-api-python-client',
'argparse',
'python-gflags'
'argparse'
],
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand Down
6 changes: 4 additions & 2 deletions test/test_appscale_terminate_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,16 @@ def test_terminate_in_gce_and_succeeds(self):
fake_storage = flexmock(name='fake_storage')
fake_storage.should_receive('get').and_return(None)

fake_flags = oauth2client.tools.argparser.parse_args(args=[])

flexmock(oauth2client.file)
oauth2client.file.should_receive('Storage').with_args(str).and_return(
fake_storage)

fake_credentials = flexmock(name='fake_credentials')
flexmock(oauth2client.tools)
oauth2client.tools.should_receive('run').with_args(fake_flow,
fake_storage).and_return(fake_credentials)
oauth2client.tools.should_receive('run_flow').with_args(fake_flow,
fake_storage, fake_flags).and_return(fake_credentials)

# next, mock out http calls to GCE
fake_http = flexmock(name='fake_http')
Expand Down