<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>Script_magic</string> </key>
            <value> <int>3</int> </value>
        </item>
        <item>
            <key> <string>_bind_names</string> </key>
            <value>
              <object>
                <klass>
                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
                </klass>
                <tuple/>
                <state>
                  <dictionary>
                    <item>
                        <key> <string>_asgns</string> </key>
                        <value>
                          <dictionary>
                            <item>
                                <key> <string>name_container</string> </key>
                                <value> <string>container</string> </value>
                            </item>
                            <item>
                                <key> <string>name_context</string> </key>
                                <value> <string>context</string> </value>
                            </item>
                            <item>
                                <key> <string>name_m_self</string> </key>
                                <value> <string>script</string> </value>
                            </item>
                            <item>
                                <key> <string>name_subpath</string> </key>
                                <value> <string>traverse_subpath</string> </value>
                            </item>
                          </dictionary>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>_body</string> </key>
            <value> <string>instance = state_change[\'object\']\n
portal = instance.getPortalObject()\n
# Get required arguments\n
kwargs = state_change.kwargs\n
\n
# Required args\n
# Raise TypeError if all parameters are not provided\n
try:\n
  software_release_url_string = state_change.kwargs[\'software_release\']\n
  software_type = kwargs["software_type"]\n
  instance_xml = kwargs["instance_xml"]\n
  sla_xml = kwargs["sla_xml"]\n
  is_slave = kwargs["shared"]\n
except KeyError:\n
  raise TypeError, "RequestedInstance_updateParameterInformation takes exactly 5 arguments"\n
\n
edit_kw = {\n
  \'root_software_release_url\': software_release_url_string,\n
  \'text_content\': instance_xml,\n
  \'source_reference\': software_type,\n
  \'sla_xml\': sla_xml,\n
}\n
\n
# Check the slave management\n
if is_slave not in [True, False]:\n
  raise ValueError, "shared should be a boolean"\n
instance_portal_type = instance.getPortalType()\n
if instance_portal_type == "Hosting Subscription":\n
  edit_kw[\'root_slave\'] = is_slave\n
elif instance_portal_type == "Software Instance":\n
  if is_slave:\n
    raise NotImplementedError, "Please destroy before doing a slave instance (%s)" % \\\n
      (instance.getRelativeUrl(), )\n
elif instance_portal_type == "Slave Instance":\n
  if not is_slave:\n
    raise NotImplementedError, "Please destroy before doing a software instance (%s)" % \\\n
      (instance.getRelativeUrl(), )\n
else:\n
  raise NotImplementedError, "Not supported portal type %s (%s)" % \\\n
    (instance.getPortalType(), instance.getRelativeUrl())\n
\n
instance.edit(**edit_kw)\n
</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>state_change</string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>RequestedInstance_updateParameterInformation</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
