omelette : optionnal prefix for symlinks' sources

Bug #1359807 reported by Régis Rouet
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
collective.buildout
New
Undecided
Unassigned

Bug Description

When you access/use the omelette part from another server _ LXC host, sshfs _ chances are that the symlinks are broken.

If you don't mind the links to be broken on the server executing omelette, you want to make them so they are valid from where you use them.

This can be done quickly with a patch on omelette/__init__.py like :

@@ -123,9 +123,9 @@
                                 if name.startswith('.'):
                                     continue
                                 name_parts = ns_parts + (name,)
- src = os.path.join(dist.location, *name_parts)
+ src = '/data/ulxc/t2/rootfs' + os.path.join(dist.location, *name_parts)
                                 dst = os.path.join(location, *name_parts)
- if os.path.exists(dst):
+ if os.path.lexists(dst):
                                     continue
                                 symlink(src, dst)
                     create_namespaces(namespaces)

A recipe option to obtain the same result would be nice.

description: updated
Revision history for this message
Wichert Akkerman (wichert) wrote :

Did you intend to hardcode '/data/ulxc/t2/rootfs' ? That won't work for anyone but you.

Revision history for this message
Régis Rouet (regis-rouet) wrote :

Of course not, the path would be in the buildout wich execute omelette, like :

[omelette]
recipe = collective.recipe.omelette
eggs = ${buildout:eggs}
rootfs=/data/ulxc/t2/rootfs

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.