Skip to content

Commit

Permalink
Merge pull request #18 from HSF/k8s_analysis
Browse files Browse the repository at this point in the history
k8s: replaced leftover requests call
  • Loading branch information
fbarreir authored Nov 21, 2019
2 parents 8fce8c4 + c1cf17d commit 6e3f8e6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pandaharvester/harvestercloud/k8s_startup_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import mimetypes
import ssl
import urlparse
import urllib2

logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s %(message)s',
filename='/tmp/vm_script.log', filemode='w')
Expand Down Expand Up @@ -96,14 +97,11 @@ def upload_logs(url, log_file_name, destination_name, proxy_cert):
def get_url(url, headers=None):
"""
get content from specified URL
TODO: error handling
"""
reply = requests.get(url, headers=headers)
if reply.status_code != 200:
logging.debug('[get_attribute] Failed to open {0}'.format(url))
return None
else:
return reply.content

response = urllib2.urlopen(wrapper_url)
content = response.read()
return content

def get_configuration():

Expand Down

0 comments on commit 6e3f8e6

Please sign in to comment.