gana2188 / google-cloud-sdk

Automatically exported from code.google.com/p/google-cloud-sdk
0 stars 0 forks source link

core config variable CLOUDSDK_SCOPES is tuple, should be list, breaks method _CheckForExtraScopes() #128

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
=========================
in a bash terminal:
export CLOUDSDK_EXTRA_SCOPES=any_value
gcloud -h

If CLOUDSDK_EXTRA_SCOPES is set to any value, any commands to gcloud will be 
broken.

What is the expected output? What do you see instead?
==================================
Expect to see a list of commands allowed to follow 'gcloud' when executing 
'gcloud -h'.  Instead I get a traceback:

Traceback (most recent call last):
  File "/Users/me/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 91, in <module>
    from googlecloudsdk.calliope import base
  File "/Users/me/google-cloud-sdk/./lib/googlecloudsdk/calliope/base.py", line 8, in <module>
    from googlecloudsdk.calliope import usage_text
  File "/Users/me/google-cloud-sdk/./lib/googlecloudsdk/calliope/usage_text.py", line 13, in <module>
    from googlecloudsdk.core.util import console_io
  File "/Users/me/google-cloud-sdk/./lib/googlecloudsdk/core/util/console_io.py", line 13, in <module>
    from googlecloudsdk.core import log
  File "/Users/me/google-cloud-sdk/./lib/googlecloudsdk/core/log.py", line 12, in <module>
    from googlecloudsdk.core import properties
  File "/Users/me/google-cloud-sdk/./lib/googlecloudsdk/core/properties.py", line 10, in <module>
    from googlecloudsdk.core import config
  File "/Users/me/google-cloud-sdk/./lib/googlecloudsdk/core/config.py", line 292, in <module>
    _CheckForExtraScopes()
  File "/Users/me/google-cloud-sdk/./lib/googlecloudsdk/core/config.py", line 290, in _CheckForExtraScopes
    CLOUDSDK_SCOPES.extend(extra_scopes.split())

What is the output of 'gcloud info'?
=======================
Google Cloud SDK [0.9.55]

Platform: [Mac OS X, x86_64]
Python Version: [2.7.7 (default, Jun 14 2014, 23:12:13)  [GCC 4.2.1 Compatible 
Apple LLVM 5.1 (clang-503.0.40)]]
Site Packages: [Enabled]

Installation Root: [/Users/me/google-cloud-sdk]
Installed Components:
  core: [2015.04.09]
  core-nix: [2014.10.20]
  compute: [2015.04.09]
  gcloud: [2015.04.09]
  gsutil-nix: [4.6]
  gcloud-extensions-darwin-x86_64: [0.13.1]
  gsutil: [4.11]
  bq: [2.0.18]
  dns: [2015.04.09]
  sql: [2015.04.09]
  gcutil: [1.16.5]
  gcutil-nix: [1.16.5]
  bq-nix: [2.0.18]
System PATH: 
[/Users/me/google-cloud-sdk/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/us
r/local/bin:/opt/X11/bin:/usr/local/go/bin:/usr/texbin:/Users/me/google-cloud-sd
k/bin]
Cloud SDK on PATH: [True]

Installation Properties: [/Users/me/google-cloud-sdk/properties]
User Config Directory: [/Users/me/.config/gcloud]
User Properties: [/Users/me/.config/gcloud/properties]
Current Workspace: [None]
Workspace Config Directory: [None]
Workspace Properties: [None]

Account: [my.email@domain.com]
Project: [my-default-project]

Current Properties:
  [core]
    project: [my-default-project]
    account: [my.email@domain.com]
    disable_usage_reporting: [False]

Logs Directory: [/Users/me/.config/gcloud/logs]
Last Log File: [/Users/me/.config/gcloud/logs/2015.04.13/10.27.20.431827.log]

Please provide any additional information below.
==============================
Everything worked fine after I edited 
/Users/me/google-cloud-sdk/./lib/googlecloudsdk/core/config.py so that global 
variable CLOUDSDK_SCOPES was a list (for which the 'extend' method is defined) 
rather than a tuple (which has no method 'extend').  This variable is defined 
on lines 276-282.

Original issue reported on code.google.com by amandeep...@workiva.com on 13 Apr 2015 at 4:39

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This will break shit for anyone trying to use the datastore, and it's a very, 
very, very quick fix.  I think you should prioritize this higher.

Original comment by amandeep...@workiva.com on 23 Apr 2015 at 4:58

GoogleCodeExporter commented 8 years ago
This was somewhat undocumented feature. In a process of removing something 
else, a bug was made where list got changed to tuple.

Note that latest version no longer supports CLOUDSDK_SCOPES environment 
variable.

You can update via
  https://cloud.google.com/sdk/gcloud/reference/components/update

Original comment by che...@google.com on 23 Apr 2015 at 6:04

GoogleCodeExporter commented 8 years ago
> will break shit for anyone trying to use the datastore

you no longer need to set CLOUDSDK_EXTRA_SCOPES for datastore.

Original comment by che...@google.com on 23 Apr 2015 at 6:20