Commit 6e0fd3ba authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_subscription: Set default values.

parent 338682fe
...@@ -2,7 +2,6 @@ if context.getAggregate() is not None: ...@@ -2,7 +2,6 @@ if context.getAggregate() is not None:
return return
person = context.getDestinationSectionValue() person = context.getDestinationSectionValue()
if person is None: if person is None:
return return
...@@ -10,14 +9,22 @@ if context.getSimulationState() == "confirmed": ...@@ -10,14 +9,22 @@ if context.getSimulationState() == "confirmed":
return return
request_kw = {} request_kw = {}
default_xml = """<?xml version="1.0" encoding="utf-8"?>
<instance>
</instance>
"""
if context.getUrlString() is None:
raise ValueError("url_string cannot be None")
request_kw.update( request_kw.update(
software_release=context.getUrlString(), software_release=context.getUrlString(),
# Bad title # Bad title
software_title=context.getTitle() + " %s" % str(context.getUid()), software_title=context.getTitle() + " %s" % str(context.getUid()),
software_type=context.getSourceReference(), software_type=context.getSourceReference("default"),
instance_xml=context.getTextContent().strip(), instance_xml=context.getTextContent(default_xml).strip(),
sla_xml=context.getSlaXml().strip(), sla_xml=context.getSlaXml(default_xml).strip(),
shared=context.getRootSlave(), shared=bool(context.getRootSlave(0)),
state="started", state="started",
) )
......
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 to comment