def upload_input(self, user_info): """ Calls to zip the provided input files then uploads them to the user's storage container. :param user_info: :return: """ # Convert to Windows format norm_inputs = (os.path.normpath(self.input)) # Create pickle file for user_info f = 'C:/Users/' + comp_user + '/Simulations/' + user_info[ "username"] + '/AzureUserInfo.pickle' pickle.dump(user_info, file(f, 'w')) # Zip input files inputs_zip = AzureTools.zip_files(user_info["username"], norm_inputs) # Try uploading the specified input try: blob_service.put_block_blob_from_path( user_info["username"].lower(), self.vm_id, inputs_zip) except: stderr.write('An error occurred uploading your input.') exit(1)
def upload_input(self, user_info): """ Calls to zip the provided input files then uploads them to the user's storage container. :param user_info: :return: """ # Convert to Windows format norm_inputs = (os.path.normpath(self.input)) # Create pickle file for user_info f = 'C:/Users/' + comp_user + '/Simulations/' + user_info["username"] + '/AzureUserInfo.pickle' pickle.dump(user_info,file(f, 'w')) # Zip input files inputs_zip = AzureTools.zip_files(user_info["username"], norm_inputs) # Try uploading the specified input try: blob_service.put_block_blob_from_path(user_info["username"].lower(), self.vm_id, inputs_zip) except: stderr.write('An error occurred uploading your input.') exit(1)