[one-users] possible bug on tm_mad/common/context
Javier Fontan
jfontan at opennebula.org
Tue Mar 4 08:15:11 PST 2014
You are right. This functionality was meant to give the file a correct name
when using FILES_DS. In that datastore the files don't have the original
name but a hash, just like other "images".
We can think about adding that feature but the path must be checked to make
sure the file will be inside the cdrom.
Can you open an issue?
On Mon, Mar 3, 2014 at 2:46 PM, Olivier Sallou <olivier.sallou at irisa.fr>wrote:
> After deeper tests, quotes are not the issue, it is just that if target
> contains a directory path, it is not created, and cp fails.
>
> A "mkdir -p basename_of_target" would solve the issue and allow to copy
> files in a subdirectory.
>
> Current code only allows the renaming of a file, not copying it in
> sub-directories of the CDROM.
>
> Olivier
>
>
> On 03/03/2014 02:33 PM, Olivier Sallou wrote:
>
> Hi,
> I made some tests and looking at code of tm_context, I think there is a
> possible bug:
> (src/tm_mad/common/context)
>
> In code:
>
> for f in "${SRC[@]}"; do
> case "$f" in
> http://*)
> exec_and_set_error "$WGET -P $ISO_DIR $f" "Error downloading $f"
> ;;
> *)
> if echo "$f" | grep -q ':'; then
> target=$(echo "$f"|cut -d':' -f2-)
> target="'$target'"
> f=$(echo "$f"|cut -d':' -f1)
>
>
> If a target is set with something like : f = /path_to_my_
> file:subdir/my_file
>
> target is then set with quotes, in the above example target='subdir/myfile'
>
> Following command is:
>
> exec_and_set_error "cp -R $f $ISO_DIR/$target" \
> "Error copying $f to $ISO_DIR"
>
> The cp will fail: cp -R /path_to_my_file $ISO_DIR/'subdir/myfile'
> There are quotes in cp target path.
>
> Am I correct. I made a try and it failed, but I wonder if it is code part
> or an other error I made somewhere else.
>
> Olivier
>
> --
> Olivier Sallou
> IRISA / University of Rennes 1
> Campus de Beaulieu, 35000 RENNES - FRANCE
> Tel: 02.99.84.71.95
>
> gpg key id: 4096R/326D8438 (keyring.debian.org)
> Key fingerprint = 5FB4 6F83 D3B9 5204 6335 D26D 78DC 68DB 326D 8438
>
>
>
>
> _______________________________________________
> Users mailing listUsers at lists.opennebula.orghttp://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
>
> --
> Olivier Sallou
> IRISA / University of Rennes 1
> Campus de Beaulieu, 35000 RENNES - FRANCE
> Tel: 02.99.84.71.95
>
> gpg key id: 4096R/326D8438 (keyring.debian.org)
> Key fingerprint = 5FB4 6F83 D3B9 5204 6335 D26D 78DC 68DB 326D 8438
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
>
--
Javier Fontán Muiños
Developer
OpenNebula - The Open Source Toolkit for Data Center Virtualization
www.OpenNebula.org | @OpenNebula | github.com/jfontan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20140304/f198b826/attachment-0002.htm>
More information about the Users
mailing list