Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ def install_azcopy(self, install_location):
else:
raise CLIError('Azcopy ({}) does not exist.'.format(self.system))
try:
os.chmod(install_dir, os.stat(install_dir).st_mode | stat.S_IWUSR)
_urlretrieve(file_url, install_location)
os.chmod(install_location,
os.stat(install_location).st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
except PermissionError as err:
raise CLIError(f'Permission error while attempting to download azcopy to {install_dir}. '
f'You could install the specified azcopy version {AZCOPY_VERSION} manually or '
f'grant write permission and retry. ({err})')
Comment on lines +59 to +62
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PermissionError is thrown by

with open(install_location, 'wb') as f:
f.write(zip_file.read(fileName))

Guess it's better to capture it here?

except IOError as err:
raise CLIError('Connection error while attempting to download azcopy {}. You could also install the '
'specified azcopy version to {} manually. ({})'.format(AZCOPY_VERSION, install_dir, err))
Expand Down