Commit e12f1b9f by Kálmán Viktor

occi: storagelink fixes

parent a36b5aa3
...@@ -448,7 +448,7 @@ class StorageLink(Link): ...@@ -448,7 +448,7 @@ class StorageLink(Link):
def init_attrs(self, instance, disk): def init_attrs(self, instance, disk):
self.attrs = {} self.attrs = {}
self.attrs['occi.core.id'] = "vm%d_disk%d" % (instance.pk, disk.pk) self.attrs['occi.core.id'] = "vm_%d_disk_%d" % (instance.pk, disk.pk)
self.attrs['occi.core.target'] = Storage(disk).render_location() self.attrs['occi.core.target'] = Storage(disk).render_location()
self.attrs['occi.core.source'] = Compute(instance).render_location() self.attrs['occi.core.source'] = Compute(instance).render_location()
# deviceid? mountpoint? # deviceid? mountpoint?
...@@ -715,12 +715,12 @@ LINK_KIND = Kind( ...@@ -715,12 +715,12 @@ LINK_KIND = Kind(
STORAGE_LINK_ATTRS = LINK_ATTRS + [ STORAGE_LINK_ATTRS = LINK_ATTRS + [
Attribute("occi.storagelink.deviceid"), Attribute("occi.storagelink.deviceid"),
Attribute("occi.storagelink.mountpoint"), Attribute("occi.storagelink.mountpoint"),
Attribute("occi.core.state", "immutable"), Attribute("occi.storagelink.state", "immutable"),
] ]
STORAGE_LINK_KIND = Kind( STORAGE_LINK_KIND = Kind(
term="storagelink", term="storagelink",
scheme="http://schemas.ogf.org/occi/infrastructure#", scheme="http://schemas.ogf.org/occi/infrastructure#storagelink",
class_="kind", class_="kind",
title="Storage link", title="Storage link",
rel="http://schemas.ogf.org/occi/core#link", rel="http://schemas.ogf.org/occi/core#link",
......
{% spaceless %} {% spaceless %}
Link: <{{ target }}>; rel="{{ kind.rel }}"; self="{{ location }}"; category="{{ kind.scheme }}storagelink"; {% for k, v in attrs.items %}{{ k }}={% if v.isdigit == False or k == "occi.core.id" %}"{{ v }}"{% else %}{{ v }}{% endif %}{% if not forloop.last %}; {% endif %}{% endfor %} Link: <{{ target }}>; rel="{{ kind.rel }}"; self="{{ location }}"; category="{{ kind.scheme }}"; {% for k, v in attrs.items %}{{ k }}={% if v.isdigit == False or k == "occi.core.id" %}"{{ v }}"{% else %}{{ v }}{% endif %}{% if not forloop.last %}; {% endif %}{% endfor %}
{% endspaceless %} {% endspaceless %}
Category: compute; scheme="{{ kind.scheme }}"; class="{{ kind.class }}"; Category: storagelink; scheme="{{ kind.scheme }}"; class="{{ kind.class }}";
{% for k, v in attrs.items %} {% for k, v in attrs.items %}
X-OCCI-Attribute: {{ k }}={% if v.isdigit == False or k == "occi.core.id" %}"{{ v }}"{% else %}{{ v }}{% endif %} X-OCCI-Attribute: {{ k }}={% if v.isdigit == False or k == "occi.core.id" %}"{{ v }}"{% else %}{{ v }}{% endif %}
{% endfor %} {% endfor %}
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