Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
ce9c5700
Commit
ce9c5700
authored
Apr 16, 2013
by
Sofia Papagiannaki
Browse files
Fix pithos-reconcile-commissions command
Get pending commissions specifically for pithos Refs: #3594
parent
d037ce11
Changes
2
Hide whitespace changes
Inline
Side-by-side
snf-pithos-app/pithos/api/management/commands/pithos-reconcile-commissions.py
View file @
ce9c5700
...
...
@@ -39,19 +39,23 @@ import logging
logger
=
logging
.
getLogger
(
__name__
)
CLIENTKEY
=
'pithos'
class
Command
(
NoArgsCommand
):
help
=
"Display unresolved commissions and trigger their recovery"
def
handle_noargs
(
self
,
**
options
):
b
=
get_backend
()
try
:
pending_commissions
=
b
.
quotaholder
.
get_pending_commissions
()
pending_commissions
=
b
.
quotaholder
.
get_pending_commissions
(
clientkey
=
CLIENTKEY
)
to_accept
=
b
.
quotaholder_serials
.
lookup
(
pending_commissions
)
self
.
stdout
.
write
(
"Accept commissions: %s
\n
"
%
to_accept
)
b
.
quotaholder
.
accept_commission
(
context
=
{},
clientkey
=
'pithos'
,
clientkey
=
CLIENTKEY
,
serials
=
to_accept
)
self
.
stdout
.
write
(
"Delete serials: %s
\n
"
%
to_accept
)
...
...
@@ -61,7 +65,7 @@ class Command(NoArgsCommand):
self
.
stdout
.
write
(
"Reject commissions: %s
\n
"
%
to_reject
)
b
.
quotaholder
.
reject_commission
(
context
=
{},
clientkey
=
'pithos'
,
clientkey
=
CLIENTKEY
,
serials
=
to_reject
)
...
...
snf-pithos-backend/pithos/backends/lib/sqlalchemy/quotaholder_serials.py
View file @
ce9c5700
...
...
@@ -71,7 +71,7 @@ class QuotaholderSerial(DBWorker):
return
rows
def
lookup
(
self
,
serials
):
"""Return the serials."""
"""Return the
registered
serials."""
if
not
serials
:
return
[]
...
...
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