Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add process describe output formatter

  • Loading branch information...
commit b64a76d29c74f71bb406d4ef792bc2bf336ae4a4 1 parent 43eb8f3
@oldpatricka oldpatricka authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 ceiclient/commands.py
View
19 ceiclient/commands.py
@@ -699,6 +699,18 @@ def execute(client, opts):
class PDDescribeProcess(CeiCommand):
name = 'describe'
+ output_template = '''ID = {{ result.upid }}
+Name = {{ result.name }}
+State = {{ result.state }}
+Hostname = {{ result.hostname }}
+EEAgent = {{ result.assigned }}
+Node Exclusive = {{ result.node_exclusive }}
+Queueing Mode = {{ result.queueing_mode }}
+Restart Mode = {{ result.restart_mode }}
+Starts = {{ result.starts }}
+Constraints = {{ result.constraints }}
+Configuration = {{ result.configuration }}
+'''
def __init__(self, subparsers):
parser = subparsers.add_parser(self.name)
@@ -708,6 +720,13 @@ def __init__(self, subparsers):
def execute(client, opts):
return client.describe_process(opts.process_id)
+ @staticmethod
+ def output(result):
+ template = Template(PDDescribeProcess.output_template)
+ result['constraints'] = yaml.safe_dump(result['constraints']).rstrip('\n')
+ result['configuration'] = yaml.safe_dump(result['configuration']).rstrip('\n')
+ print template.render(result=result)
+
class PDWaitProcess(CeiCommand):
Please sign in to comment.
Something went wrong with that request. Please try again.