LGTM, thanks.

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

> Add network related constants to the Haskell to Python constant generation.
>
> Signed-off-by: Jose A. Lopes <[email protected]>
> ---
>  lib/constants.py          | 33 +++++++++++++++---------------
>  src/Ganeti/HsConstants.hs | 52
> +++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 68 insertions(+), 17 deletions(-)
>
> diff --git a/lib/constants.py b/lib/constants.py
> index 4baafa8..0cf3b91 100644
> --- a/lib/constants.py
> +++ b/lib/constants.py
> @@ -423,27 +423,26 @@ MAX_TAG_LEN = _constants.MAX_TAG_LEN
>  MAX_TAGS_PER_OBJ = _constants.MAX_TAGS_PER_OBJ
>
>  # others
> -DEFAULT_BRIDGE = "xen-br0"
> -DEFAULT_OVS = "switch1"
> -CLASSIC_DRBD_SYNC_SPEED = 60 * 1024  # 60 MiB, expressed in KiB
> -IP4_ADDRESS_LOCALHOST = "127.0.0.1"
> -IP4_ADDRESS_ANY = "0.0.0.0"
> -IP6_ADDRESS_LOCALHOST = "::1"
> -IP6_ADDRESS_ANY = "::"
> -IP4_VERSION = 4
> -IP6_VERSION = 6
> -VALID_IP_VERSIONS = compat.UniqueFrozenset([IP4_VERSION, IP6_VERSION])
> +DEFAULT_BRIDGE = _constants.DEFAULT_BRIDGE
> +DEFAULT_OVS = _constants.DEFAULT_OVS
> +CLASSIC_DRBD_SYNC_SPEED = _constants.CLASSIC_DRBD_SYNC_SPEED
> +IP4_ADDRESS_LOCALHOST = _constants.IP4_ADDRESS_LOCALHOST
> +IP4_ADDRESS_ANY = _constants.IP4_ADDRESS_ANY
> +IP6_ADDRESS_LOCALHOST = _constants.IP6_ADDRESS_LOCALHOST
> +IP6_ADDRESS_ANY = _constants.IP6_ADDRESS_ANY
> +IP4_VERSION = _constants.IP4_VERSION
> +IP6_VERSION = _constants.IP6_VERSION
> +VALID_IP_VERSIONS = _constants.VALID_IP_VERSIONS
>  # for export to htools
>  IP4_FAMILY = socket.AF_INET
>  IP6_FAMILY = socket.AF_INET6
>
> -TCP_PING_TIMEOUT = 10
> -DEFAULT_VG = "xenvg"
> -DEFAULT_DRBD_HELPER = "/bin/true"
> -MIN_VG_SIZE = 20480
> -DEFAULT_MAC_PREFIX = "aa:00:00"
> -# default maximum instance wait time, in seconds.
> -DEFAULT_SHUTDOWN_TIMEOUT = 120
> +TCP_PING_TIMEOUT = _constants.TCP_PING_TIMEOUT
> +DEFAULT_VG = _constants.DEFAULT_VG
> +DEFAULT_DRBD_HELPER = _constants.DEFAULT_DRBD_HELPER
> +MIN_VG_SIZE = _constants.MIN_VG_SIZE
> +DEFAULT_MAC_PREFIX = _constants.DEFAULT_MAC_PREFIX
> +DEFAULT_SHUTDOWN_TIMEOUT = _constants.DEFAULT_SHUTDOWN_TIMEOUT
>  NODE_MAX_CLOCK_SKEW = _constants.NODE_MAX_CLOCK_SKEW
>  # Time for an intra-cluster disk transfer to wait for a connection
>  DISK_TRANSFER_CONNECT_TIMEOUT = 60
> diff --git a/src/Ganeti/HsConstants.hs b/src/Ganeti/HsConstants.hs
> index 6fe04bc..f860e04 100644
> --- a/src/Ganeti/HsConstants.hs
> +++ b/src/Ganeti/HsConstants.hs
> @@ -1075,6 +1075,58 @@ maxTagLen = 128
>  maxTagsPerObj :: Int
>  maxTagsPerObj = 4096
>
> +-- * Others
> +
> +defaultBridge :: String
> +defaultBridge = "xen-br0"
> +
> +defaultOvs :: String
> +defaultOvs = "switch1"
> +
> +-- | 60 MiB, expressed in KiB
> +classicDrbdSyncSpeed :: Int
> +classicDrbdSyncSpeed = 60 * 1024
> +
> +ip4AddressAny :: String
> +ip4AddressAny = "0.0.0.0"
> +
> +ip4AddressLocalhost :: String
> +ip4AddressLocalhost = "127.0.0.1"
> +
> +ip6AddressAny :: String
> +ip6AddressAny = "::"
> +
> +ip6AddressLocalhost :: String
> +ip6AddressLocalhost = "::1"
> +
> +ip4Version :: Int
> +ip4Version = 4
> +
> +ip6Version :: Int
> +ip6Version = 6
> +
> +validIpVersions :: FrozenSet Int
> +validIpVersions = ConstantUtils.mkSet [ip4Version, ip6Version]
> +
> +tcpPingTimeout :: Int
> +tcpPingTimeout = 10
> +
> +defaultVg :: String
> +defaultVg = "xenvg"
> +
> +defaultDrbdHelper :: String
> +defaultDrbdHelper = "/bin/true"
> +
> +minVgSize :: Int
> +minVgSize = 20480
> +
> +defaultMacPrefix :: String
> +defaultMacPrefix = "aa:00:00"
> +
> +-- | Default maximum instance wait time, in seconds.
> +defaultShutdownTimeout :: Int
> +defaultShutdownTimeout = 120
> +
>  -- | Node clock skew in seconds
>  nodeMaxClockSkew :: Int
>  nodeMaxClockSkew = 150
> --
> 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