cleanup bigquery filenames to one spot
diff --git a/planetstack/hpc_wizard/bigquery_analytics.py b/planetstack/hpc_wizard/bigquery_analytics.py
index 4a90c2b..cb3038a 100644
--- a/planetstack/hpc_wizard/bigquery_analytics.py
+++ b/planetstack/hpc_wizard/bigquery_analytics.py
@@ -18,6 +18,8 @@
from oauth2client.file import Storage
from oauth2client.tools import run_flow,run
+from bigquery_config import BIGQUERY_SECRETS_FN, BIGQUERY_CREDENTIALS_FN
+
"""
yum -y install python-httplib2
easy_install python_gflags
@@ -27,7 +29,7 @@
PROJECT_NUMBER = '549187599759'
try:
- FLOW = flow_from_clientsecrets('/opt/planetstack/hpc_wizard/client_secrets.json',
+ FLOW = flow_from_clientsecrets(BIGQUERY_SECRETS_FN,
scope='https://www.googleapis.com/auth/bigquery')
BIGQUERY_AVAILABLE = True
except:
@@ -92,7 +94,7 @@
except:
pass
- storage = Storage('/opt/planetstack/hpc_wizard/bigquery_credentials.dat')
+ storage = Storage(BIGQUERY_CREDENTIALS_FN)
credentials = storage.get()
if credentials is None or credentials.invalid:
diff --git a/planetstack/hpc_wizard/bigquery_config.py b/planetstack/hpc_wizard/bigquery_config.py
new file mode 100644
index 0000000..0ed1f80
--- /dev/null
+++ b/planetstack/hpc_wizard/bigquery_config.py
@@ -0,0 +1,3 @@
+BIGQUERY_DIR = "/opt/planetstack"
+BIGQUERY_SECRETS_FN = os.path.join(BIGQUERY_DIR, "client_secrets.json")
+BIGQUERY_CREDENTIALS_FN = os.path.join(BIGQUERY_DIR, "bigquery_credentials.dat")
diff --git a/planetstack/hpc_wizard/query.py b/planetstack/hpc_wizard/query.py
index 4ddf4f6..874022e 100644
--- a/planetstack/hpc_wizard/query.py
+++ b/planetstack/hpc_wizard/query.py
@@ -17,6 +17,8 @@
from oauth2client.file import Storage
from oauth2client.tools import run_flow,run
+from bigquery_config import BIGQUERY_SECRETS_FN, BIGQUERY_CREDENTIALS_FN
+
"""
yum -y install python-httplib2
easy_install python_gflags
@@ -27,7 +29,7 @@
PROJECT_NUMBER = '549187599759'
try:
- FLOW = flow_from_clientsecrets('/opt/planetstack/hpc_wizard/client_secrets.json',
+ FLOW = flow_from_clientsecrets(BIGQUERY_SECRETS_FN,
scope='https://www.googleapis.com/auth/bigquery')
except:
print "exception while initializing bigquery flow"
@@ -60,7 +62,7 @@
return resp
def run_query(self, query):
- storage = Storage('/opt/planetstack/hpc_wizard/bigquery_credentials.dat')
+ storage = Storage(BIGQUERY_CREDENTIALS_FN)
credentials = storage.get()
if credentials is None or credentials.invalid: