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:
Tobias Henkel
2020-10-14 22:33:33 +02:00
parent 4b19def07d
commit e854c90f1f

View File

@@ -24,10 +24,8 @@ __metaclass__ = type
Generic utilities used for log upload. Generic utilities used for log upload.
""" """
import datetime
import gzip import gzip
import io import io
import json
import logging import logging
import mimetypes import mimetypes
import os import os
@@ -42,8 +40,6 @@ except ImportError:
import zlib import zlib
import collections import collections
import google.auth.compute_engine.credentials as gce_cred
try: try:
# Python 3.3+ # Python 3.3+
@@ -249,20 +245,6 @@ def sizeof_fmt(num, suffix='B'):
return "%.1f%s%s" % (num, 'Y', suffix) 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(): class FileDetail():
""" """
Used to generate indexes with links or as the file path Used to generate indexes with links or as the file path