LGTM, thanks.

On Mon, Oct 7, 2013 at 4:37 PM, Jose A. Lopes <[email protected]> wrote:

> Add DRBD and dynamic disk parameter constants to the Haskell to Python
> constant generation.
>
> Signed-off-by: Jose A. Lopes <[email protected]>
> ---
>  lib/constants.py          |  75 ++++++++++++----------------------
>  src/Ganeti/HsConstants.hs | 100
> ++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 126 insertions(+), 49 deletions(-)
>
> diff --git a/lib/constants.py b/lib/constants.py
> index 12e5698..c97fa37 100644
> --- a/lib/constants.py
> +++ b/lib/constants.py
> @@ -759,55 +759,32 @@ LDP_ACCESS = _constants.LDP_ACCESS
>  DISK_LD_TYPES = _constants.DISK_LD_TYPES
>  DISK_LD_PARAMETERS = _constants.DISK_LD_PARAMETERS
>
> -# Disk template parameters (can be set/changed by the user via
> gnt-cluster and
> -# gnt-group)
> -DRBD_RESYNC_RATE = "resync-rate"
> -DRBD_DATA_STRIPES = "data-stripes"
> -DRBD_META_STRIPES = "meta-stripes"
> -DRBD_DISK_BARRIERS = "disk-barriers"
> -DRBD_META_BARRIERS = "meta-barriers"
> -DRBD_DEFAULT_METAVG = "metavg"
> -DRBD_DISK_CUSTOM = "disk-custom"
> -DRBD_NET_CUSTOM = "net-custom"
> -DRBD_PROTOCOL = "protocol"
> -DRBD_DYNAMIC_RESYNC = "dynamic-resync"
> -DRBD_PLAN_AHEAD = "c-plan-ahead"
> -DRBD_FILL_TARGET = "c-fill-target"
> -DRBD_DELAY_TARGET = "c-delay-target"
> -DRBD_MAX_RATE = "c-max-rate"
> -DRBD_MIN_RATE = "c-min-rate"
> -LV_STRIPES = "stripes"
> -RBD_POOL = "pool"
> -RBD_ACCESS = "access"
> -DISK_DT_TYPES = {
> -  DRBD_RESYNC_RATE: VTYPE_INT,
> -  DRBD_DATA_STRIPES: VTYPE_INT,
> -  DRBD_META_STRIPES: VTYPE_INT,
> -  DRBD_DISK_BARRIERS: VTYPE_STRING,
> -  DRBD_META_BARRIERS: VTYPE_BOOL,
> -  DRBD_DEFAULT_METAVG: VTYPE_STRING,
> -  DRBD_DISK_CUSTOM: VTYPE_STRING,
> -  DRBD_NET_CUSTOM: VTYPE_STRING,
> -  DRBD_PROTOCOL: VTYPE_STRING,
> -  DRBD_DYNAMIC_RESYNC: VTYPE_BOOL,
> -  DRBD_PLAN_AHEAD: VTYPE_INT,
> -  DRBD_FILL_TARGET: VTYPE_INT,
> -  DRBD_DELAY_TARGET: VTYPE_INT,
> -  DRBD_MAX_RATE: VTYPE_INT,
> -  DRBD_MIN_RATE: VTYPE_INT,
> -  LV_STRIPES: VTYPE_INT,
> -  RBD_POOL: VTYPE_STRING,
> -  RBD_ACCESS: VTYPE_STRING,
> -  }
> -
> -DISK_DT_PARAMETERS = frozenset(DISK_DT_TYPES.keys())
> -
> -# dynamic disk parameters
> -DDP_LOCAL_IP = "local-ip"
> -DDP_REMOTE_IP = "remote-ip"
> -DDP_PORT = "port"
> -DDP_LOCAL_MINOR = "local-minor"
> -DDP_REMOTE_MINOR = "remote-minor"
> +DRBD_RESYNC_RATE = _constants.DRBD_RESYNC_RATE
> +DRBD_DATA_STRIPES = _constants.DRBD_DATA_STRIPES
> +DRBD_META_STRIPES = _constants.DRBD_META_STRIPES
> +DRBD_DISK_BARRIERS = _constants.DRBD_DISK_BARRIERS
> +DRBD_META_BARRIERS = _constants.DRBD_META_BARRIERS
> +DRBD_DEFAULT_METAVG = _constants.DRBD_DEFAULT_METAVG
> +DRBD_DISK_CUSTOM = _constants.DRBD_DISK_CUSTOM
> +DRBD_NET_CUSTOM = _constants.DRBD_NET_CUSTOM
> +DRBD_PROTOCOL = _constants.DRBD_PROTOCOL
> +DRBD_DYNAMIC_RESYNC = _constants.DRBD_DYNAMIC_RESYNC
> +DRBD_PLAN_AHEAD = _constants.DRBD_PLAN_AHEAD
> +DRBD_FILL_TARGET = _constants.DRBD_FILL_TARGET
> +DRBD_DELAY_TARGET = _constants.DRBD_DELAY_TARGET
> +DRBD_MAX_RATE = _constants.DRBD_MAX_RATE
> +DRBD_MIN_RATE = _constants.DRBD_MIN_RATE
> +LV_STRIPES = _constants.LV_STRIPES
> +RBD_ACCESS = _constants.RBD_ACCESS
> +RBD_POOL = _constants.RBD_POOL
> +DISK_DT_TYPES = _constants.DISK_DT_TYPES
> +DISK_DT_PARAMETERS = _constants.DISK_DT_PARAMETERS
> +
> +DDP_LOCAL_IP = _constants.DDP_LOCAL_IP
> +DDP_REMOTE_IP = _constants.DDP_REMOTE_IP
> +DDP_PORT = _constants.DDP_PORT
> +DDP_LOCAL_MINOR = _constants.DDP_LOCAL_MINOR
> +DDP_REMOTE_MINOR = _constants.DDP_REMOTE_MINOR
>
>  # OOB supported commands
>  OOB_POWER_ON = _constants.OOB_POWER_ON
> diff --git a/src/Ganeti/HsConstants.hs b/src/Ganeti/HsConstants.hs
> index 6421d0d..383af05 100644
> --- a/src/Ganeti/HsConstants.hs
> +++ b/src/Ganeti/HsConstants.hs
> @@ -1950,6 +1950,106 @@ diskLdTypes =
>  diskLdParameters :: FrozenSet String
>  diskLdParameters = ConstantUtils.mkSet (Map.keys diskLdTypes)
>
> +-- * Disk template parameters
> +--
> +-- Disk template parameters can be set/changed by the user via
> +-- gnt-cluster and gnt-group)
> +
> +drbdResyncRate :: String
> +drbdResyncRate = "resync-rate"
> +
> +drbdDataStripes :: String
> +drbdDataStripes = "data-stripes"
> +
> +drbdMetaStripes :: String
> +drbdMetaStripes = "meta-stripes"
> +
> +drbdDiskBarriers :: String
> +drbdDiskBarriers = "disk-barriers"
> +
> +drbdMetaBarriers :: String
> +drbdMetaBarriers = "meta-barriers"
> +
> +drbdDefaultMetavg :: String
> +drbdDefaultMetavg = "metavg"
> +
> +drbdDiskCustom :: String
> +drbdDiskCustom = "disk-custom"
> +
> +drbdNetCustom :: String
> +drbdNetCustom = "net-custom"
> +
> +drbdProtocol :: String
> +drbdProtocol = "protocol"
> +
> +drbdDynamicResync :: String
> +drbdDynamicResync = "dynamic-resync"
> +
> +drbdPlanAhead :: String
> +drbdPlanAhead = "c-plan-ahead"
> +
> +drbdFillTarget :: String
> +drbdFillTarget = "c-fill-target"
> +
> +drbdDelayTarget :: String
> +drbdDelayTarget = "c-delay-target"
> +
> +drbdMaxRate :: String
> +drbdMaxRate = "c-max-rate"
> +
> +drbdMinRate :: String
> +drbdMinRate = "c-min-rate"
> +
> +lvStripes :: String
> +lvStripes = "stripes"
> +
> +rbdAccess :: String
> +rbdAccess = "access"
> +
> +rbdPool :: String
> +rbdPool = "pool"
> +
> +diskDtTypes :: Map String VType
> +diskDtTypes =
> +  Map.fromList [(drbdResyncRate, VTypeInt),
> +                (drbdDataStripes, VTypeInt),
> +                (drbdMetaStripes, VTypeInt),
> +                (drbdDiskBarriers, VTypeString),
> +                (drbdMetaBarriers, VTypeBool),
> +                (drbdDefaultMetavg, VTypeString),
> +                (drbdDiskCustom, VTypeString),
> +                (drbdNetCustom, VTypeString),
> +                (drbdProtocol, VTypeString),
> +                (drbdDynamicResync, VTypeBool),
> +                (drbdPlanAhead, VTypeInt),
> +                (drbdFillTarget, VTypeInt),
> +                (drbdDelayTarget, VTypeInt),
> +                (drbdMaxRate, VTypeInt),
> +                (drbdMinRate, VTypeInt),
> +                (lvStripes, VTypeInt),
> +                (rbdAccess, VTypeString),
> +                (rbdPool, VTypeString)]
> +
> +diskDtParameters :: FrozenSet String
> +diskDtParameters = ConstantUtils.mkSet (Map.keys diskDtTypes)
> +
> +-- * Dynamic disk parameters
> +
> +ddpLocalIp :: String
> +ddpLocalIp = "local-ip"
> +
> +ddpRemoteIp :: String
> +ddpRemoteIp = "remote-ip"
> +
> +ddpPort :: String
> +ddpPort = "port"
> +
> +ddpLocalMinor :: String
> +ddpLocalMinor = "local-minor"
> +
> +ddpRemoteMinor :: String
> +ddpRemoteMinor = "remote-minor"
> +
>  -- * OOB supported commands
>
>  oobPowerOn :: 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

Reply via email to