Sandro Bonazzola has uploaded a new change for review. Change subject: nfs: domain uuid directory must be specified as destination ......................................................................
nfs: domain uuid directory must be specified as destination Previously no check was done on -n parameter for ensuring that the destionation was an export domain uuid directory. Now the -n parameter is validated checking for the export domain uuid directory as destination. The output of --help and the man page have been updated to explicitly refer to the domain uuid directory. Additionally, the path to the log direcotry has been updated in the man page. Change-Id: Ic3e2f1ab6a6788a0ce80130c32171f69e7562c56 Bug-Url: https://bugzilla.redhat.com/950634 Signed-off-by: Sandro Bonazzola <sbona...@redhat.com> --- M src/__main__.py M src/engine-image-uploader.8 2 files changed, 19 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-image-uploader refs/changes/62/20362/1 diff --git a/src/__main__.py b/src/__main__.py index 616364c..60e4b33 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -1319,6 +1319,17 @@ elif self.configuration.get('nfs_server'): mnt = self.configuration.get('nfs_server') (address, sep, path) = mnt.partition(':') + base = os.path.basename(path) + try: + uuid.UUID(base, version=4) + except ValueError: + raise Exception( + _( + 'The specified nfs path is not an export domain: ' + 'you must include the domain uuid directory in ' + 'the path.' + ) + ) else: raise Exception(_("either export-domain or nfs-server must be provided")) @@ -1529,7 +1540,7 @@ help=_("""the NFS server to which the file(s) should be uploaded. This option is an alternative to export-domain and should not be combined with export-domain. Use this when you want to upload files to a specific -NFS server (e.g.--nfs-server=example.com:/path/to/some/dir)"""), +NFS server (e.g.--nfs-server=example.com:/path/to/export/<uuid>)"""), metavar=_("NFSSERVER")) export_group.add_option("-i", "--ovf-id", dest="rename_ovf", action="store_false", default=True, diff --git a/src/engine-image-uploader.8 b/src/engine-image-uploader.8 index 44888ff..dc58527 100644 --- a/src/engine-image-uploader.8 +++ b/src/engine-image-uploader.8 @@ -57,7 +57,10 @@ .IP "\fB\-e EXPORT_STORAGE_DOMAIN, \-\-export\-domain=EXPORT_STORAGE_DOMAIN\fP" The export storage domain to which the file(s) should be uploaded.\& .IP "\fB\-n NFSSERVER, \-\-nfs\-server=NFSSERVER\fP" -The NFS server to which the file(s) should be uploaded. This option is an alternative to export\-domain and should not be combined with export\-domain. Use this when you want to upload files to a specific NFS server (for example, \-\-nfs\-server=example.com:/path/to/some/dir)\& +The NFS server to which the file(s) should be uploaded. +This option is an alternative to export\-domain and should not be combined with export\-domain. +Use this when you want to upload files to a specific NFS server +(for example, \-\-nfs\-server=example.com:/path/to/export/<uuid>)\& .IP "\fB\-i, \-\-ovf\-id\fP" Use this option if you do not want to update the UUID of the image. By default, the tool will generate a new UUID for the image. This ensures that there is no conflict between the id of the incoming image and those already in oVirt Engine.\& .IP "\fB\-d, \-\-disk\-instance\-id\fP" @@ -140,9 +143,11 @@ .nf /etc/ovirt\-engine/imageuploader.conf .br -/var/log/engine\-image\-uploader.log +/var/log/ovirt\-engine/ovirt\-image\-uploader/*.log .fi .SH "AUTHORS" Keith Robertson .nf Chris Negus +.nf +Sandro Bonazzola -- To view, visit http://gerrit.ovirt.org/20362 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic3e2f1ab6a6788a0ce80130c32171f69e7562c56 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-image-uploader Gerrit-Branch: master Gerrit-Owner: Sandro Bonazzola <sbona...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches