LGTM, thanks
On Thu, Jan 16, 2014 at 3:26 PM, Klaus Aehlig <[email protected]> wrote: > This parameter of OpClusterSetParams will allow to set the > maximal number of jobs to be run simultaneously. > > Signed-off-by: Klaus Aehlig <[email protected]> > --- > lib/cmdlib/cluster.py | 3 +++ > src/Ganeti/OpCodes.hs | 1 + > src/Ganeti/OpParams.hs | 6 ++++++ > test/hs/Test/Ganeti/OpCodes.hs | 1 + > 4 files changed, 11 insertions(+) > > diff --git a/lib/cmdlib/cluster.py b/lib/cmdlib/cluster.py > index 8130a3a..db6a22a 100644 > --- a/lib/cmdlib/cluster.py > +++ b/lib/cmdlib/cluster.py > @@ -1331,6 +1331,9 @@ class LUClusterSetParams(LogicalUnit): > # we need to update the pool size here, otherwise the save will fail > AdjustCandidatePool(self, [], feedback_fn) > > + if self.op.max_running_jobs is not None: > + self.cluster.max_running_jobs = self.op.max_running_jobs > + > if self.op.maintain_node_health is not None: > if self.op.maintain_node_health and not constants.ENABLE_CONFD: > feedback_fn("Note: CONFD was disabled at build time, node health" > diff --git a/src/Ganeti/OpCodes.hs b/src/Ganeti/OpCodes.hs > index 2380879..9c9d736 100644 > --- a/src/Ganeti/OpCodes.hs > +++ b/src/Ganeti/OpCodes.hs > @@ -215,6 +215,7 @@ $(genOpCode "OpCode" > , pClusterOsParams > , pDiskParams > , pCandidatePoolSize > + , pMaxRunningJobs > , pUidPool > , pAddUids > , pRemoveUids > diff --git a/src/Ganeti/OpParams.hs b/src/Ganeti/OpParams.hs > index 25ab53b..75403c0 100644 > --- a/src/Ganeti/OpParams.hs > +++ b/src/Ganeti/OpParams.hs > @@ -119,6 +119,7 @@ module Ganeti.OpParams > , pClusterOsParams > , pInstOsParams > , pCandidatePoolSize > + , pMaxRunningJobs > , pUidPool > , pAddUids > , pRemoveUids > @@ -628,6 +629,11 @@ pCandidatePoolSize = > withDoc "Master candidate pool size" . > optionalField $ simpleField "candidate_pool_size" [t| Positive Int |] > > +pMaxRunningJobs :: Field > +pMaxRunningJobs = > + withDoc "Maximal number of jobs to run simultaneously" . > + optionalField $ simpleField "max_running_jobs" [t| Positive Int |] > + > pUidPool :: Field > pUidPool = > withDoc "Set UID pool, must be list of lists describing UID ranges\ > diff --git a/test/hs/Test/Ganeti/OpCodes.hs > b/test/hs/Test/Ganeti/OpCodes.hs > index 84fa52b..228ece9 100644 > --- a/test/hs/Test/Ganeti/OpCodes.hs > +++ b/test/hs/Test/Ganeti/OpCodes.hs > @@ -176,6 +176,7 @@ instance Arbitrary OpCodes.OpCode where > genMaybe genEmptyContainer <*> emptyMUD <*> > genMaybe genEmptyContainer <*> genMaybe genEmptyContainer <*> > genMaybe genEmptyContainer <*> genMaybe arbitrary <*> > + genMaybe arbitrary <*> > arbitrary <*> arbitrary <*> arbitrary <*> > arbitrary <*> arbitrary <*> arbitrary <*> > emptyMUD <*> emptyMUD <*> arbitrary <*> > -- > 1.8.5.2 > >
