<?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>"""Dirty script to return Software Instance state"""\n
import json\n
state = context.getSlapState()\n
has_partition = context.getAggregate(portal_type="Computer Partition")\n
result = \'Unable to calculate the status...\'\n
if has_partition:\n
  try:\n
    memcached_dict = context.getPortalObject().portal_memcached.getMemcachedDict(\n
      key_prefix=\'slap_tool\',\n
      plugin_path=\'portal_memcached/default_memcached_plugin\')\n
    try:\n
      d = memcached_dict[context.getReference()]\n
    except KeyError:\n
      result = context.getSlapStateTitle()\n
    else:\n
      d = json.loads(d)\n
      result = d[\'text\']\n
      if result.startswith(\'#access \'):\n
        result = result[len(\'#access \'):]\n
\n
  except Exception:\n
    raise\n
    result = \'There is system issue, please try again later.\'\n
\n
else:\n
  if state in ["start_requested", "stop_requested"]:\n
    result = \'Looking for a free partition\'\n
  elif state in ["destroy_requested"]:\n
    result = \'Destroyed\'\n
\n
return result\n
</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string></string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>SoftwareInstance_getStatus</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
