Revision 884dc063
b/lib/cmdlib/instance.py | ||
---|---|---|
36 | 36 |
from ganeti import masterd |
37 | 37 |
from ganeti import netutils |
38 | 38 |
from ganeti import objects |
39 |
from ganeti import opcodes |
|
40 | 39 |
from ganeti import pathutils |
41 | 40 |
from ganeti import rpc |
42 | 41 |
from ganeti import utils |
... | ... | |
1992 | 1991 |
""" |
1993 | 1992 |
(allocatable, failed) = self.ia_result |
1994 | 1993 |
return { |
1995 |
opcodes.OpInstanceMultiAlloc.ALLOCATABLE_KEY: |
|
1996 |
map(compat.fst, allocatable), |
|
1997 |
opcodes.OpInstanceMultiAlloc.FAILED_KEY: failed, |
|
1994 |
constants.ALLOCATABLE_KEY: map(compat.fst, allocatable), |
|
1995 |
constants.FAILED_KEY: failed, |
|
1998 | 1996 |
} |
1999 | 1997 |
|
2000 | 1998 |
def Exec(self, feedback_fn): |
b/lib/constants.py | ||
---|---|---|
2554 | 2554 |
|
2555 | 2555 |
# Do not re-export imported modules |
2556 | 2556 |
del re, _vcsversion, _autoconf, socket, pathutils, compat |
2557 |
|
|
2558 |
|
|
2559 |
ALLOCATABLE_KEY = "allocatable" |
|
2560 |
FAILED_KEY = "failed" |
b/lib/ht.py | ||
---|---|---|
722 | 722 |
TInstanceMultiAllocResponse = \ |
723 | 723 |
TStrictDict(True, True, { |
724 | 724 |
constants.JOB_IDS_KEY: Comment("List of submitted jobs")(TJobIdList), |
725 |
ALLOCATABLE_KEY: TListOf(TNonEmptyString), |
|
726 |
FAILED_KEY: TListOf(TNonEmptyString) |
|
725 |
constants.ALLOCATABLE_KEY: TListOf(TNonEmptyString),
|
|
726 |
constants.FAILED_KEY: TListOf(TNonEmptyString)
|
|
727 | 727 |
}) |
b/lib/opcodes.py | ||
---|---|---|
1364 | 1364 |
"List of instance create opcodes describing the instances to allocate"), |
1365 | 1365 |
] |
1366 | 1366 |
_JOB_LIST = ht.Comment("List of submitted jobs")(TJobIdList) |
1367 |
ALLOCATABLE_KEY = "allocatable" |
|
1368 |
FAILED_KEY = "allocatable" |
|
1369 | 1367 |
OP_RESULT = ht.TStrictDict(True, True, { |
1370 | 1368 |
constants.JOB_IDS_KEY: _JOB_LIST, |
1371 |
ALLOCATABLE_KEY: ht.TListOf(ht.TNonEmptyString), |
|
1372 |
FAILED_KEY: ht.TListOf(ht.TNonEmptyString), |
|
1369 |
constants.ALLOCATABLE_KEY: ht.TListOf(ht.TNonEmptyString),
|
|
1370 |
constants.FAILED_KEY: ht.TListOf(ht.TNonEmptyString),
|
|
1373 | 1371 |
}) |
1374 | 1372 |
|
1375 | 1373 |
def __getstate__(self): |
b/test/py/ganeti.rapi.client_unittest.py | ||
---|---|---|
503 | 503 |
def testInstancesMultiAlloc(self): |
504 | 504 |
response = { |
505 | 505 |
constants.JOB_IDS_KEY: ["23423"], |
506 |
opcodes.OpInstanceMultiAlloc.ALLOCATABLE_KEY: ["foobar"],
|
|
507 |
opcodes.OpInstanceMultiAlloc.FAILED_KEY: ["foobar2"],
|
|
506 |
constants.ALLOCATABLE_KEY: ["foobar"],
|
|
507 |
constants.FAILED_KEY: ["foobar2"],
|
|
508 | 508 |
} |
509 | 509 |
self.rapi.AddResponse(serializer.DumpJson(response)) |
510 | 510 |
insts = [self.client.InstanceAllocation("create", "foobar", |
Also available in: Unified diff