LGTM, thanks.
On Fri, Jan 17, 2014 at 5:28 PM, Klaus Aehlig <[email protected]> wrote: > ...as, in that way, they will also be available in Haskell, > where job replication happens as well. > > Signed-off-by: Klaus Aehlig <[email protected]> > --- > lib/vcluster.py | 14 +++++++------- > src/Ganeti/Constants.hs | 17 +++++++++++++++++ > 2 files changed, 24 insertions(+), 7 deletions(-) > > diff --git a/lib/vcluster.py b/lib/vcluster.py > index 407c352..0119961 100644 > --- a/lib/vcluster.py > +++ b/lib/vcluster.py > @@ -30,18 +30,18 @@ functions' docstrings for details. > import os > > from ganeti import compat > +from ganeti import _constants > +# cannot use constants, as this would cause a circular import > > > -ETC_HOSTS = "/etc/hosts" > +ETC_HOSTS = _constants.V_CLUSTER_ETC_HOSTS > > -_VIRT_PATH_PREFIX = "/###-VIRTUAL-PATH-###," > -_ROOTDIR_ENVNAME = "GANETI_ROOTDIR" > -_HOSTNAME_ENVNAME = "GANETI_HOSTNAME" > +_VIRT_PATH_PREFIX = _constants.V_CLUSTER_VIRT_PATH_PREFIX > +_ROOTDIR_ENVNAME = _constants.V_CLUSTER_ROOTDIR_ENVNAME > +_HOSTNAME_ENVNAME = _constants.V_CLUSTER_HOSTNAME_ENVNAME > > #: List of paths which shouldn't be virtualized > -_VPATH_WHITELIST = compat.UniqueFrozenset([ > - ETC_HOSTS, > - ]) > +_VPATH_WHITELIST = _constants.V_CLUSTER_VPATH_WHITELIST > > > def _GetRootDirectory(envname): > diff --git a/src/Ganeti/Constants.hs b/src/Ganeti/Constants.hs > index bd6b908..22c5b8e 100644 > --- a/src/Ganeti/Constants.hs > +++ b/src/Ganeti/Constants.hs > @@ -4281,6 +4281,23 @@ ndsSsconf = "ssconf" > ndsStartNodeDaemon :: String > ndsStartNodeDaemon = "start_node_daemon" > > +-- * VCluster related constants > + > +vClusterEtcHosts :: String > +vClusterEtcHosts = "/etc/hosts" > + > +vClusterVirtPathPrefix :: String > +vClusterVirtPathPrefix = "/###-VIRTUAL-PATH-###," > + > +vClusterRootdirEnvname :: String > +vClusterRootdirEnvname = "GANETI_ROOTDIR" > + > +vClusterHostnameEnvname :: String > +vClusterHostnameEnvname = "GANETI_HOSTNAME" > + > +vClusterVpathWhitelist :: FrozenSet String > +vClusterVpathWhitelist = ConstantUtils.mkSet [ vClusterEtcHosts ] > + > -- * The source reasons for the execution of an OpCode > > opcodeReasonSrcClient :: String > -- > 1.8.5.2 > >
