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:
return
person = context.getDestinationSectionValue()
if person is None:
return
......@@ -10,14 +9,22 @@ if context.getSimulationState() == "confirmed":
return
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(
software_release=context.getUrlString(),
# Bad title
software_title=context.getTitle() + " %s" % str(context.getUid()),
software_type=context.getSourceReference(),
instance_xml=context.getTextContent().strip(),
sla_xml=context.getSlaXml().strip(),
shared=context.getRootSlave(),
software_type=context.getSourceReference("default"),
instance_xml=context.getTextContent(default_xml).strip(),
sla_xml=context.getSlaXml(default_xml).strip(),
shared=bool(context.getRootSlave(0)),
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