Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
itminedu
synnefo
Commits
99895b3a
Commit
99895b3a
authored
Apr 17, 2013
by
Giorgos Korfiatis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
astakosclient: Change provisions argument to dict
parent
3605cf6a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
5 deletions
+3
-5
astakosclient/astakosclient/__init__.py
astakosclient/astakosclient/__init__.py
+1
-3
astakosclient/astakosclient/tests.py
astakosclient/astakosclient/tests.py
+1
-1
astakosclient/docs/index.rst
astakosclient/docs/index.rst
+1
-1
No files found.
astakosclient/astakosclient/__init__.py
View file @
99895b3a
...
...
@@ -402,9 +402,7 @@ class AstakosClient():
request
[
"name"
]
=
name
try
:
request
[
"provisions"
]
=
[]
for
p
in
provisions
:
resource
=
p
[
0
]
quantity
=
p
[
1
]
for
resource
,
quantity
in
provisions
.
iteritems
():
t
=
{
"holder"
:
holder
,
"source"
:
source
,
"resource"
:
resource
,
"quantity"
:
quantity
}
request
[
"provisions"
].
append
(
t
)
...
...
astakosclient/astakosclient/tests.py
View file @
99895b3a
...
...
@@ -954,7 +954,7 @@ class TestCommissions(unittest.TestCase):
client
=
AstakosClient
(
"https://example.com"
)
response
=
client
.
issue_one_commission
(
token_1
,
"c02f315b-7d84-45bc-a383-552a3f97d2ad"
,
"system"
,
[(
"cyclades.vm"
,
1
)
,
(
"cyclades.ram"
,
30000
)]
)
"system"
,
{
"cyclades.vm"
:
1
,
"cyclades.ram"
:
30000
}
)
except
Exception
as
err
:
self
.
fail
(
"Shouldn't have raised Exception %s"
%
err
)
self
.
assertEqual
(
response
,
commission_successful_response
[
'serial'
])
...
...
astakosclient/docs/index.rst
View file @
99895b3a
...
...
@@ -143,7 +143,7 @@ retry=0, use_pool=False, pool_size=8, logger=None\ **)**
**issue_one_commission(**\ token, holder, source, provisions, name="", force=False, auto_accept=False\ **)**
Given a service's authentication token issue a commission.
In this case we specify the holder, the source and the provisions
(a
list of (
string
,
int)
)
and astakosclient will create the
(a
dict from
string
to
int) and astakosclient will create the
corresponding commission.
In case of success return commission's id (int).
Otherwise raise an AstakosClientException exception.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment