Commit 9f0bd886 by Kálmán Viktor

occi: add title and state for compute

parent ca527975
......@@ -215,6 +215,7 @@ class Compute(Resource):
'occi.compute.hostname': "short_hostname",
'occi.compute.speed': "priority",
'occi.compute.memory': "ram_size",
'occi.core.title': "name",
}
for k, v in translate.items():
self.attrs[k] = getattr(self.instance, v, None)
......@@ -222,6 +223,13 @@ class Compute(Resource):
priority = self.instance.priority
self.attrs['occi.compute.speed'] = priority/100.0 * 5.0
status = {
'RUNNING': "active",
'SUSPENDED': "suspended",
}
self.attrs['occi.compute.state'] = status.get(self.instance.status,
"inactive")
def trigger_action(self, data):
method = None
action_term = None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment