Remove unneeded gce from upload_utils
This is gce specific and already existing in the gce specific part and can be just removed. Change-Id: I8838e3587cf5a2044bd4945f5ecea3f3290deddc
This commit is contained in:
parent
4b19def07d
commit
e854c90f1f
@ -24,10 +24,8 @@ __metaclass__ = type
|
||||
Generic utilities used for log upload.
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import gzip
|
||||
import io
|
||||
import json
|
||||
import logging
|
||||
import mimetypes
|
||||
import os
|
||||
@ -42,8 +40,6 @@ except ImportError:
|
||||
import zlib
|
||||
import collections
|
||||
|
||||
import google.auth.compute_engine.credentials as gce_cred
|
||||
|
||||
|
||||
try:
|
||||
# Python 3.3+
|
||||
@ -249,20 +245,6 @@ def sizeof_fmt(num, suffix='B'):
|
||||
return "%.1f%s%s" % (num, 'Y', suffix)
|
||||
|
||||
|
||||
class Credentials(gce_cred.Credentials):
|
||||
def __init__(self, path):
|
||||
super(Credentials, self).__init__()
|
||||
self._path = path
|
||||
self.refresh(None)
|
||||
|
||||
def refresh(self, request):
|
||||
with open(self._path) as f:
|
||||
data = json.loads(f.read())
|
||||
self.token = data['access_token']
|
||||
self.expiry = (datetime.datetime.utcnow() +
|
||||
datetime.timedelta(seconds=data['expires_in']))
|
||||
|
||||
|
||||
class FileDetail():
|
||||
"""
|
||||
Used to generate indexes with links or as the file path
|
||||
|
Loading…
x
Reference in New Issue
Block a user