def _get_remote_file(self, source, auth, dest): remote_contents = requests.get(source, auth=auth, verify=util.get_cert(), prefetch=False, config={'danger_mode' : True}) dest.write(remote_contents.content)
def _get_remote_file(self, source, auth, dest): remote_contents = requests.get(source, auth=auth, verify=util.get_cert(), prefetch=False, config={'danger_mode': True}) dest.write(remote_contents.content)
def _make_request(self, verb, base_url, params, headers): return api.request(verb, base_url, data=params if verb=='POST' else dict(), params=params if verb!='POST' else dict(), headers=headers, verify=util.get_cert(), prefetch=False, config={'danger_mode' : True})
def _archive_from_url(self, archive, auth_config): tf = tempfile.TemporaryFile() remote_contents = requests.get(archive, auth=auth_config.get_auth(None), verify=util.get_cert(), prefetch=False, config={'danger_mode': True}) tf.write(remote_contents.content) tf.flush() tf.seek(0, os.SEEK_SET) return tf
def _msi_from_url(self, archive, auth_config): tf = tempfile.mkstemp(suffix='.msi', prefix='cfn-init-tmp') remote_contents = requests.get(archive, auth=auth_config.get_auth(None), verify=util.get_cert(), prefetch=False, config={'danger_mode': True}) with os.fdopen(tf[0], 'wb') as temp_dest: temp_dest.write(remote_contents.content) return tf[1]
def _msi_from_url(self, archive, auth_config): tf = tempfile.mkstemp(suffix='.msi', prefix='cfn-init-tmp') remote_contents = requests.get(archive, auth=auth_config.get_auth(None), verify=util.get_cert(), prefetch=False, config={'danger_mode' : True}) with os.fdopen(tf[0], 'wb') as temp_dest: temp_dest.write(remote_contents.content) return tf[1]
def _archive_from_url(self, archive, auth_config): tf = tempfile.TemporaryFile() remote_contents = requests.get(archive, auth=auth_config.get_auth(None), verify=util.get_cert(), prefetch=False, config={'danger_mode' : True}) tf.write(remote_contents.content) tf.flush() tf.seek(0, os.SEEK_SET) return tf