LGTM, thanks.
On Mon, Oct 7, 2013 at 4:38 PM, Jose A. Lopes <[email protected]> wrote: > Add 'ispecsMinmaxDefaults' to the Haskell to Python constant generation. > > Signed-off-by: Jose A. Lopes <[email protected]> > --- > lib/constants.py | 22 ++-------------------- > src/Ganeti/HsConstants.hs | 22 ++++++++++++++++++++++ > 2 files changed, 24 insertions(+), 20 deletions(-) > > diff --git a/lib/constants.py b/lib/constants.py > index 536459e..f82390d 100644 > --- a/lib/constants.py > +++ b/lib/constants.py > @@ -1435,26 +1435,8 @@ NICC_DEFAULTS = { > NIC_VLAN: VALUE_HS_NOTHING, > } > > -# All of the following values are quite arbitrarily - there are no > -# "good" defaults, these must be customised per-site > -ISPECS_MINMAX_DEFAULTS = { > - ISPECS_MIN: { > - ISPEC_MEM_SIZE: 128, > - ISPEC_CPU_COUNT: 1, > - ISPEC_DISK_COUNT: 1, > - ISPEC_DISK_SIZE: 1024, > - ISPEC_NIC_COUNT: 1, > - ISPEC_SPINDLE_USE: 1, > - }, > - ISPECS_MAX: { > - ISPEC_MEM_SIZE: 32768, > - ISPEC_CPU_COUNT: 8, > - ISPEC_DISK_COUNT: MAX_DISKS, > - ISPEC_DISK_SIZE: 1024 * 1024, > - ISPEC_NIC_COUNT: MAX_NICS, > - ISPEC_SPINDLE_USE: 12, > - }, > - } > +ISPECS_MINMAX_DEFAULTS = _constants.ISPECS_MINMAX_DEFAULTS > + > IPOLICY_DEFAULTS = { > ISPECS_MINMAX: [ISPECS_MINMAX_DEFAULTS], > ISPECS_STD: { > diff --git a/src/Ganeti/HsConstants.hs b/src/Ganeti/HsConstants.hs > index fa962c8..b301de5 100644 > --- a/src/Ganeti/HsConstants.hs > +++ b/src/Ganeti/HsConstants.hs > @@ -3428,6 +3428,28 @@ hvcGlobals = > ndcGlobals :: FrozenSet String > ndcGlobals = ConstantUtils.mkSet [ndExclusiveStorage] > > +-- | All of the following values are quite arbitrary - there are no > +-- "good" defaults, these must be customised per-site > +ispecsMinmaxDefaults :: Map String (Map String Int) > +ispecsMinmaxDefaults = > + Map.fromList > + [(ispecsMin, > + Map.fromList > + [(ConstantUtils.ispecMemSize, Types.iSpecMemorySize > Types.defMinISpec), > + (ConstantUtils.ispecCpuCount, Types.iSpecCpuCount Types.defMinISpec), > + (ConstantUtils.ispecDiskCount, Types.iSpecDiskCount > Types.defMinISpec), > + (ConstantUtils.ispecDiskSize, Types.iSpecDiskSize Types.defMinISpec), > + (ConstantUtils.ispecNicCount, Types.iSpecNicCount Types.defMinISpec), > + (ConstantUtils.ispecSpindleUse, Types.iSpecSpindleUse > Types.defMinISpec)]), > + (ispecsMax, > + Map.fromList > + [(ConstantUtils.ispecMemSize, Types.iSpecMemorySize > Types.defMaxISpec), > + (ConstantUtils.ispecCpuCount, Types.iSpecCpuCount Types.defMaxISpec), > + (ConstantUtils.ispecDiskCount, Types.iSpecDiskCount > Types.defMaxISpec), > + (ConstantUtils.ispecDiskSize, Types.iSpecDiskSize Types.defMaxISpec), > + (ConstantUtils.ispecNicCount, Types.iSpecNicCount Types.defMaxISpec), > + (ConstantUtils.ispecSpindleUse, Types.iSpecSpindleUse > Types.defMaxISpec)])] > + > -- * Confd > > confdProtocolVersion :: Int > -- > 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
