diff options
author | Radostin Stoyanov <rstoyanov1@gmail.com> | 2017-06-29 18:44:31 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cbosdonnat@suse.com> | 2017-07-01 07:36:46 +0200 |
commit | 96109db4bd08ffc1e1dcca6f87994761642ce413 (patch) | |
tree | a2a88000158901b4261aa89b01ca46b186446d3a | |
parent | bb5932eea5e0f9c32bb782ca70e2c9d0af0e0940 (diff) | |
download | virt-bootstrap.git-96109db4bd08ffc1e1dcca6f87994761642ce413.tar.gz virt-bootstrap.git-96109db4bd08ffc1e1dcca6f87994761642ce413.tar.xz virt-bootstrap.git-96109db4bd08ffc1e1dcca6f87994761642ce413.zip |
Check for write permissions on destination path
-rwxr-xr-x | src/virtBootstrap/virt_bootstrap.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/virtBootstrap/virt_bootstrap.py b/src/virtBootstrap/virt_bootstrap.py index bef5e88..90379cc 100755 --- a/src/virtBootstrap/virt_bootstrap.py +++ b/src/virtBootstrap/virt_bootstrap.py @@ -96,6 +96,9 @@ def bootstrap(args): elif not os.path.isdir(args.dest): # Show error if not directory error("Destination path '%s' is not directory.", args.dest) sys.exit(1) + elif not os.access(args.dest, os.W_OK): # Check write permissions + error("No write permissions on destination path '%s'", args.dest) + sys.exit(1) source.unpack(args.dest) |