Merge "freezer session-* improvements"
This commit is contained in:
@@ -55,8 +55,6 @@ class FreezerCommandManager(commandmanager.CommandManager):
|
||||
'session-create': sessions.SessionCreate,
|
||||
'session-add-job': sessions.SessionAddJob,
|
||||
'session-remove-job': sessions.SessionRemoveJob,
|
||||
'session-start': sessions.SessionStart,
|
||||
'session-end': sessions.SessionEnd,
|
||||
'session-update': sessions.SessionUpdate,
|
||||
'action-show': actions.ActionShow,
|
||||
'action-list': actions.ActionList,
|
||||
|
||||
@@ -90,22 +90,18 @@ class SessionList(lister.Lister):
|
||||
search=parsed_args.search
|
||||
)
|
||||
|
||||
columns = ('Session ID', 'Description', 'Status', '# Jobs')
|
||||
|
||||
# Print empty table if no sessions found
|
||||
if not sessions:
|
||||
sessions = [{}]
|
||||
data = ((session.get('session_id', ''),
|
||||
session.get('description', ''),
|
||||
session.get('status', ''),
|
||||
session.get('jobs', ''),
|
||||
) for session in sessions)
|
||||
else:
|
||||
data = ((session.get('session_id'),
|
||||
session.get('description'),
|
||||
session.get('status'),
|
||||
len(session.get('jobs', [])),
|
||||
) for session in sessions)
|
||||
|
||||
columns = ('Session ID', 'Description', 'Status', '# Jobs')
|
||||
data = ((
|
||||
session.get('session_id', ''),
|
||||
session.get('description', ''),
|
||||
session.get('status', ''),
|
||||
len(session.get('jobs', [])) if session.get(
|
||||
'session_id') else '',
|
||||
) for session in sessions)
|
||||
|
||||
return columns, data
|
||||
|
||||
@@ -174,24 +170,6 @@ class SessionRemoveJob(command.Command):
|
||||
parsed_args.job_id, parsed_args.session_id))
|
||||
|
||||
|
||||
class SessionStart(command.Command):
|
||||
"""Start a session"""
|
||||
def get_parser(self, prog_name):
|
||||
pass
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
pass
|
||||
|
||||
|
||||
class SessionEnd(command.Command):
|
||||
"""Stop a session"""
|
||||
def get_parser(self, prog_name):
|
||||
pass
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
pass
|
||||
|
||||
|
||||
class SessionUpdate(command.Command):
|
||||
"""Update a session from a file"""
|
||||
def get_parser(self, prog_name):
|
||||
|
||||
Reference in New Issue
Block a user