LGTM, thanks.
On Mon, Oct 7, 2013 at 4:37 PM, Jose A. Lopes <[email protected]> wrote: > Add DRBD and RBD related constants to the Haskell to Python constant > generation. > > Signed-off-by: Jose A. Lopes <[email protected]> > --- > lib/constants.py | 27 ++++++++++++--------------- > src/Ganeti/HsConstants.hs | 36 ++++++++++++++++++++++++++++++++++++ > 2 files changed, 48 insertions(+), 15 deletions(-) > > diff --git a/lib/constants.py b/lib/constants.py > index 6b54f88..42fdf9e 100644 > --- a/lib/constants.py > +++ b/lib/constants.py > @@ -308,14 +308,6 @@ DISK_TEMPLATES = _constants.DISK_TEMPLATES > DEFAULT_ENABLED_DISK_TEMPLATES = _constants.DEFAULT_ENABLED_DISK_TEMPLATES > > MAP_DISK_TEMPLATE_STORAGE_TYPE = _constants.MAP_DISK_TEMPLATE_STORAGE_TYPE > -# drbd constants > -DRBD_HMAC_ALG = "md5" > -DRBD_DEFAULT_NET_PROTOCOL = "C" > -DRBD_MIGRATION_NET_PROTOCOL = "C" > -DRBD_STATUS_FILE = "/proc/drbd" > - > -#: Size of DRBD meta block device > -DRBD_META_SIZE = 128 > > DTS_INT_MIRROR = _constants.DTS_INT_MIRROR > DTS_EXT_MIRROR = _constants.DTS_EXT_MIRROR > @@ -329,11 +321,17 @@ DTS_COPYABLE = _constants.DTS_COPYABLE > DTS_EXCL_STORAGE = _constants.DTS_EXCL_STORAGE > DTS_NO_FREE_SPACE_CHECK = _constants.DTS_NO_FREE_SPACE_CHECK > DTS_BLOCK = _constants.DTS_BLOCK > -# drbd barrier types > -DRBD_B_NONE = "n" > -DRBD_B_DISK_BARRIERS = "b" > -DRBD_B_DISK_DRAIN = "d" > -DRBD_B_DISK_FLUSH = "f" > + > +DRBD_HMAC_ALG = _constants.DRBD_HMAC_ALG > +DRBD_DEFAULT_NET_PROTOCOL = _constants.DRBD_DEFAULT_NET_PROTOCOL > +DRBD_MIGRATION_NET_PROTOCOL = _constants.DRBD_MIGRATION_NET_PROTOCOL > +DRBD_STATUS_FILE = _constants.DRBD_STATUS_FILE > +DRBD_META_SIZE = _constants.DRBD_META_SIZE > + > +DRBD_B_NONE = _constants.DRBD_B_NONE > +DRBD_B_DISK_BARRIERS = _constants.DRBD_B_DISK_BARRIERS > +DRBD_B_DISK_DRAIN = _constants.DRBD_B_DISK_DRAIN > +DRBD_B_DISK_FLUSH = _constants.DRBD_B_DISK_FLUSH > > # Valid barrier combinations: "n" or any non-null subset of "bfd" > DRBD_VALID_BARRIER_OPT = compat.UniqueFrozenset([ > @@ -347,8 +345,7 @@ DRBD_VALID_BARRIER_OPT = compat.UniqueFrozenset([ > frozenset([DRBD_B_DISK_BARRIERS, DRBD_B_DISK_FLUSH, DRBD_B_DISK_DRAIN]), > ]) > > -# rbd tool command > -RBD_CMD = "rbd" > +RBD_CMD = _constants.RBD_CMD > > FD_BLKTAP = _constants.FD_BLKTAP > FD_LOOP = _constants.FD_LOOP > diff --git a/src/Ganeti/HsConstants.hs b/src/Ganeti/HsConstants.hs > index 31de298..ea36d2e 100644 > --- a/src/Ganeti/HsConstants.hs > +++ b/src/Ganeti/HsConstants.hs > @@ -854,6 +854,42 @@ dtsBlock = > ConstantUtils.mkSet $ > map Types.diskTemplateToRaw [DTPlain, DTDrbd8, DTBlock, DTRbd, DTExt] > > +-- * Drbd > + > +drbdHmacAlg :: String > +drbdHmacAlg = "md5" > + > +drbdDefaultNetProtocol :: String > +drbdDefaultNetProtocol = "C" > + > +drbdMigrationNetProtocol :: String > +drbdMigrationNetProtocol = "C" > + > +drbdStatusFile :: String > +drbdStatusFile = "/proc/drbd" > + > +-- | Size of DRBD meta block device > +drbdMetaSize :: Int > +drbdMetaSize = 128 > + > +-- * Drbd barrier types > + > +drbdBDiskBarriers :: String > +drbdBDiskBarriers = "b" > + > +drbdBDiskDrain :: String > +drbdBDiskDrain = "d" > + > +drbdBDiskFlush :: String > +drbdBDiskFlush = "f" > + > +drbdBNone :: String > +drbdBNone = "n" > + > +-- | Rbd tool command > +rbdCmd :: String > +rbdCmd = "rbd" > + > -- * File backend driver > > fdBlktap :: String > -- > 1.8.4 > > -- Thomas Thrainer | Software Engineer | [email protected] | Google Germany GmbH Dienerstr. 12 80331 München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores
