This patch looks good, except for the stuff mentioned below,
which were due to insufficient specification.
On Thu, May 23, 2013 at 10:51:15AM +0100, Tiago Gomes wrote:
+ ['rsync', '-r', '-a', '-z',
+ temp_root + os.path.sep, new_orig])
The -a option makes -r redundant. -z shouldn't be needed, since
it's all within the same system.
However, since we set timestamps to the same value when building
systems, and rsync relies partly on timestamp comparisons to
notice when files have changed, by default, I think adding
--checksum would be a good idea.
Further, --numeric-ids would be a good idea, since there's no
guarantee the host system (where "morph deploy" is run) has the
+ def get_version_label(self, mp):
+ version_label = os.environ.get('VERSION_LABEL')
+ # Find a new version label if VERSION_LABEL was not given
+ i = 2
+ while version_label is None:
+ file = os.path.join(mp, 'systems', 'version' + str(i))
+ if not os.path.isdir(file):
+ version_label = 'version' + str(i)
+ i += 1
+ return version_label
We want both the disk based, and NFS based deplopyments to do this in
the same way.
* They should use the same environment variable for the user to decide
on the name. Currently nfsboot uses VERSION, and this patch uses
VERSION_LABEL. I don't like the name VERSION, since it is quite generic,
and might easily conflict with other extensions. What's a good name?
I don't mind VERSION_LABEL, but now would be a good time to pick
a good name, so we don't need to change it in the future.
* This version is trying to invent a name if the user didn't give one.
nfsboot just hardcodes 'version1' as the default. The approach in
the code snipped quoted above isn't really good: it encourages
names such as 'version1', 'version2', instead of more meaningful
I think the initial name, for the first install, should be "factory",
not "version1", unless the user specifies another name. I also think
that when doing an upgrade (not first install), the MUST specify a name,
rather than having code invent one if not given. In other words, if
upgrading and user hasn't set a name, then fail. (The failing should
happen as early as possible, so that the user does not have to wait
long to know they did something wrong.)
http://www.codethink.co.uk/ http://wiki.baserock.org/ http://www.baserock.com/