--- a/usr/src/lib/install_engine/__init__.py Wed Apr 13 20:00:11 2011 -0700
+++ b/usr/src/lib/install_engine/__init__.py Thu Apr 14 09:56:06 2011 -0600
@@ -1183,7 +1183,7 @@
snap_path = self.get_zfs_snapshot_fullpath(cp_data.name)
if snap_path in zfs_snapshots:
snap_name = self.get_zfs_snapshot_name(cp_data.name)
- self.dataset.destroy(snap_name)
+ self.dataset.destroy(dry_run=False, snapshot=snap_name)
# Destroy the special engine-internal "last" dataset
snap_path = \
--- a/usr/src/lib/install_engine/test/test_engine.py Wed Apr 13 20:00:11 2011 -0700
+++ b/usr/src/lib/install_engine/test/test_engine.py Thu Apr 14 09:56:06 2011 -0600
@@ -22,7 +22,7 @@
#
#
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
#
'''Some unit tests to cover engine functionality'''
@@ -72,6 +72,9 @@
def rollback(self, name, recursive=True):
pass
+ def get(self, property):
+ return getattr(self, property)
+
class MockDOC(object):
''' Fake DOC object so the real DataObjectCache object we do not rely
--- a/usr/src/lib/install_engine/test/test_engine_complex.py Wed Apr 13 20:00:11 2011 -0700
+++ b/usr/src/lib/install_engine/test/test_engine_complex.py Thu Apr 14 09:56:06 2011 -0600
@@ -22,7 +22,7 @@
#
#
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
#
'''
@@ -37,7 +37,7 @@
import solaris_install.engine as engine
from solaris_install.data_object.data_dict import DataObjectDict
-from solaris_install.target import zfs
+from solaris_install.target.logical import Filesystem
from test_engine import EngineCheckpointsBase
@@ -62,9 +62,9 @@
'''
if _PERMISSIONS and not _LEAVE_ZFS:
- base_ds = zfs.Dataset(_ZFS_TEST_DS_BASE)
+ base_ds = Filesystem(_ZFS_TEST_DS_BASE)
if base_ds.exists:
- base_ds.destroy(recursive=True)
+ base_ds.destroy(dry_run=False, recursive=True)
def setUp():
@@ -83,7 +83,7 @@
__dataset = None
def get_dataset(self):
- '''Returns a zfs.Dataset for test purposes. If the ZFS dataset already
+ '''Returns a Filesystem for test purposes. If the ZFS dataset already
exists, the test is aborted, to prevent accidental destruction of data.
If a dataset is given, it is stored and destroyed (as well as any
descendants) after test execution'''
@@ -101,7 +101,7 @@
# for the tests. If can not find a unique name within 15 tries,
# notify the user, so, they can do some cleanup of their test datasets.
for x in xrange(15):
- dataset = zfs.Dataset(ds_name % x)
+ dataset = Filesystem(ds_name % x)
tried.append(dataset.name)
if not dataset.exists:
break
@@ -109,7 +109,7 @@
raise SkipTest("Could not generate unique ZFS dataset to safely"
" test. Tried: %s" % tried)
- dataset.create()
+ dataset.create(dry_run=False)
self.__dataset = dataset
return dataset
@@ -117,7 +117,7 @@
# Clear out ZFS dataset
if (self.__dataset is not None and self.__dataset.exists and
not _LEAVE_ZFS and not _DEFER_DESTROY_ZFS):
- self.__dataset.destroy(recursive=True)
+ self.__dataset.destroy(dry_run=False, recursive=True)
self.__dataset = None
EngineCheckpointsBase.tearDown(self)
@@ -140,7 +140,7 @@
dataset = self.get_dataset()
self.engine.dataset = dataset
cp_data = self.engine.get_cp_data(self.name_list[0])
- snap = zfs.Dataset(dataset.snapname(".step_" + cp_data.name))
+ snap = Filesystem(dataset.snapname(".step_" + cp_data.name))
self.engine.snapshot(cp_data)
self.assertTrue(os.path.exists(cp_data.data_cache_path),
@@ -155,7 +155,7 @@
snapname = self.engine.get_zfs_snapshot_name(cp_data.name)
dataset.snapshot(snapname)
- snap = zfs.Dataset(dataset.snapname(snapname))
+ snap = Filesystem(dataset.snapname(snapname))
self.engine.snapshot(cp_data)
self.assertTrue(os.path.exists(cp_data.data_cache_path),
@@ -261,9 +261,9 @@
self.engine.execute_checkpoints()
# manually snapshots
- dataset.destroy(self.engine.get_zfs_snapshot_name(self.engine._LAST.name))
- dataset.destroy(self.engine.get_zfs_snapshot_name(self.name_list[-1]))
- dataset.destroy(self.engine.get_zfs_snapshot_name(self.name_list[-2]))
+ dataset.destroy(dry_run=False, snapshot=self.engine.get_zfs_snapshot_name(self.engine._LAST.name))
+ dataset.destroy(dry_run=False, snapshot=self.engine.get_zfs_snapshot_name(self.name_list[-1]))
+ dataset.destroy(dry_run=False, snapshot=self.engine.get_zfs_snapshot_name(self.name_list[-2]))
cp_list = self.engine.get_resumable_checkpoints()
expected_result = self.name_list[:-1]
@@ -278,9 +278,9 @@
# manually remove a snapshot in middle of checkpoint list
snap_path = self.engine.get_zfs_snapshot_name("three")
- dataset.destroy(snap_path)
+ dataset.destroy(dry_run=False, snapshot=snap_path)
snap_path = self.engine.get_zfs_snapshot_name(self.engine._LAST.name)
- dataset.destroy(snap_path)
+ dataset.destroy(dry_run=False, snapshot=snap_path)
cp_list = self.engine.get_resumable_checkpoints()
self.verify_resumable_cp_result(["one", "two", "three"], cp_list)
--- a/usr/src/lib/install_manifest/test/manifests/manifest_simple.xml Wed Apr 13 20:00:11 2011 -0700
+++ b/usr/src/lib/install_manifest/test/manifests/manifest_simple.xml Thu Apr 14 09:56:06 2011 -0600
@@ -20,19 +20,19 @@
</distro_spec>
<target>
- <target_device>
- <swap>
- <zvol name="swap">
- <size val="0"/>
+ <logical noswap="false" nodump="false">
+ <zpool name="tank">
+ <zvol name="swap" use="swap">
+ <size val="0b"/>
</zvol>
- </swap>
- </target_device>
+ </zpool>
+ </logical>
</target>
<!--
Software section.
-->
-<software name="transfer-ips-install">
+<software name="transfer-ips-install" type="IPS">
<destination>
<image img_root="/rpool/new_dc_test/build_data/pkg_image" action="create"></image>
</destination>
@@ -41,12 +41,12 @@
<origin name="http://ipkg.sfbay/dev"></origin>
</publisher>
</source>
- <software_data action="install" type="IPS">
+ <software_data action="install">
<name>SUNWcs</name>
<name>SUNWcsd</name>
<name>entire</name>
</software_data>
- <software_data action="install" type="IPS">
+ <software_data action="install">
<name>slim_install</name>
<name>system/install/media/internal</name>
</software_data>
--- a/usr/src/lib/install_manifest/test/manifests/manifest_simple_dtd_path.xml Wed Apr 13 20:00:11 2011 -0700
+++ b/usr/src/lib/install_manifest/test/manifests/manifest_simple_dtd_path.xml Thu Apr 14 09:56:06 2011 -0600
@@ -20,19 +20,19 @@
</distro_spec>
<target>
- <target_device>
- <swap>
- <zvol name="swap">
- <size val="0"/>
+ <logical noswap="false" nodump="false">
+ <zpool name="tank">
+ <zvol name="swap" use="swap">
+ <size val="0b"/>
</zvol>
- </swap>
- </target_device>
+ </zpool>
+ </logical>
</target>
<!--
Software section.
-->
-<software name="transfer-ips-install">
+<software name="transfer-ips-install" type="IPS">
<destination>
<image img_root="/rpool/new_dc_test/build_data/pkg_image" action="create"></image>
</destination>
@@ -41,12 +41,12 @@
<origin name="http://ipkg.sfbay/dev"></origin>
</publisher>
</source>
- <software_data action="install" type="IPS">
+ <software_data action="install">
<name>SUNWcs</name>
<name>SUNWcsd</name>
<name>entire</name>
</software_data>
- <software_data action="install" type="IPS">
+ <software_data action="install">
<name>slim_install</name>
<name>system/install/media/internal</name>
</software_data>
--- a/usr/src/lib/install_manifest/test/manifests/software.dtd Wed Apr 13 20:00:11 2011 -0700
+++ b/usr/src/lib/install_manifest/test/manifests/software.dtd Thu Apr 14 09:56:06 2011 -0600
@@ -18,12 +18,13 @@
CDDL HEADER END
- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
-->
<!ELEMENT software (destination?, source*, software_data*)>
+
<!--
The software name is utilized to allow users to associate
a specific software instance with a specific checkpoint.
@@ -36,10 +37,10 @@
-->
<!ATTLIST software name CDATA #IMPLIED>
+<!ATTLIST software type (IPS|SVR4|CPIO|ARCHIVE|IMAGE|P5I|DU|P5P) "IPS">
<!ELEMENT software_data (name*)>
<!ATTLIST software_data action (install|uninstall|unpack|noinstall) "install">
-<!ATTLIST software_data type (IPS|SVR4|ARCHIVE|IMAGE|P5I|DU|P5P|FILE|DIR) "IPS">
<!ELEMENT name (#PCDATA)>
@@ -72,11 +73,9 @@
<property val="false">flush-content-cache-on-success
</property>
</image>
- A property can also require a string value, rather than just true
- or false.
-->
<!ELEMENT property (#PCDATA)>
-<!ATTLIST property val CDATA #REQUIRED>
+<!ATTLIST property val (true|false) #REQUIRED>
<!--
A facet is an option that may be selected or not selected,
--- a/usr/src/lib/install_manifest/test/manifests/target.dtd Wed Apr 13 20:00:11 2011 -0700
+++ b/usr/src/lib/install_manifest/test/manifests/target.dtd Thu Apr 14 09:56:06 2011 -0600
@@ -18,38 +18,44 @@
CDDL HEADER END
- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
-->
-<!ELEMENT target (target_device+)>
-
-<!--
- A partition and slice element must be specified within a
- containing element, such as a disk, zpool or vdev. There must
- be one element, if disk or pool are specified, that is
- tagged as the root device. If no target_devices are specified
- the the application must choose the device based on its
- specific criteria and assume this is the root device.
--->
-
-<!ELEMENT target_device (disk|zpool+|swap|dump)>
-
-<!--
- If a disk is specified at the top level, that is not contained
- within a zpool specification, this disk will be assumed
- to be the root device. If a disk target is specified
- at the top level, and then a zpool with the is_root attribute
- set this is an error. The user can specify a specific
- slice within the disk to be used as the root slice. If
- no slice specified then root slice will be 0.
--->
+<!ELEMENT target (disk*, logical?)>
+<!ATTLIST target name CDATA #IMPLIED>
<!ELEMENT disk ((disk_name|disk_prop|disk_keyword|iscsi), partition*, slice*)>
<!--
- Disk name can be one of ctd, volid, devpath or devid name.
- Default is "ctd".
+ in_zpool and in_vdev are reference attributes to a
+ corresponding <zpool> name and <vdev> name under the <logical>
+ element. This is how physical elements are linked with logical
+ entries.
+
+ The values of the in_zpool and in_vdev attributes, if given, must
+ exactly match the name attributes of a zpool or vdev.
+ If one or both of these attributes are specified, it must be
+ possible to uniquely identify a zpool or vdev from them.
+
+ The in_zpool and in_vdev attributes are present on disk,
+ partition and slice elements. However, if either or both of these
+ attributes are specified for one of these elements, they should not
+ also be specified for any of its sub-elements or an error will occur.
-->
+<!ATTLIST disk in_zpool CDATA #IMPLIED>
+<!ATTLIST disk in_vdev CDATA #IMPLIED>
+<!--
+ The whole_disk attribute indicates whether or not zfs has
+ control over the entire disk. If this attribute is true,
+ control of the entire disk is given to zfs.
+-->
+<!ATTLIST disk whole_disk (true|false) "false">
+
+<!--
+ Disk name can be one of ctd, volid, devpath or devid name.
+ Default is ctd.
+-->
+
<!ELEMENT disk_name EMPTY>
<!ATTLIST disk_name name CDATA #REQUIRED>
<!ATTLIST disk_name name_type (ctd|volid|devpath|devid) "ctd">
@@ -57,125 +63,76 @@
<!ELEMENT disk_prop EMPTY>
<!ATTLIST disk_prop dev_type CDATA #IMPLIED>
<!ATTLIST disk_prop dev_vendor CDATA #IMPLIED>
+<!--
+ dev_size must be number suffixed with a size unit. e.g. 100gb
+-->
<!ATTLIST disk_prop dev_size CDATA #IMPLIED>
<!ELEMENT disk_keyword EMPTY>
<!ATTLIST disk_keyword key (boot_disk) #REQUIRED>
<!--
- A vdev must start with a disk element. The slice and partition
- elements use numerical names, such as 0 or 1. A disk must
- be named for a vdev, using the disk element notation.
+ Partition and Slice names are numeric values, e.g. 1, will be
+ interpreted as partition 1 or slice 1.
+
+ No size specification means we create the slice or partition with
+ a size value set to the size of parent element.
+
+ The name attribute may only be omitted if action is
+ use_existing_solaris2, in which case there must already be a
+ Solaris2 partition on the disk and this partition will be selected.
+ In addition, if the action is use_existing_solaris2, both the name
+ and part_type attributes are ignored when selecting a partition.
-->
-<!ELEMENT vdev (disk+, partition*, slice*)>
-<!ATTLIST vdev redundancy (mirror|raidz|raidz1|raidz2|raidz3|none) "mirror">
-
-<!ELEMENT dataset (zvol|filesystem)>
+<!ELEMENT partition (size?, slice*)>
+<!ATTLIST partition name CDATA #IMPLIED>
+<!ATTLIST partition action (create|delete|preserve|use_existing_solaris2) "create">
+<!ATTLIST partition part_type CDATA "191">
<!--
- No size specification means we create the slice the whole size of
- the disk. If multiple slices specified for one disk, with
- no sizes, this is an error. The attribute is_root is only
- valid when a slice is part of a disk definition, outside of
- a zpool definition. The user can request to format the disk
- with multiple slices but specify one that they want to
- be included in the root pool.
-
+ The in_zpool and in_vdev attributes follow the same rules as the
+ similarly named attributes of disk
-->
+<!ATTLIST partition in_zpool CDATA #IMPLIED>
+<!ATTLIST partition in_vdev CDATA #IMPLIED>
<!ELEMENT slice (size?)>
+<!ATTLIST slice name CDATA #REQUIRED>
<!ATTLIST slice action (create|delete|preserve) "create">
-<!ATTLIST slice name CDATA #REQUIRED>
-<!ATTLIST slice is_root (true|false) #IMPLIED>
<!--
- The use of the 'force' attribute on slice specifies that on
- a 'create' of a slice that already exists we overwrite the
- slice if force==true. Otherwise the application errors.
+ If the create action is specified for a slice that already
+ exists, then the force attribute defines how to proceed. If
+ force is true then the operation will continue; otherwise an
+ error will occur.
-->
-
<!ATTLIST slice force (true|false) "false">
<!--
- If partition size is not provided the partition will be the
- remaining free size left on the disk.
+ The in_zpool and in_vdev attributes follow the same rules as the
+ similarly named attributes of disk
-->
-
-<!ELEMENT partition (slice*, size?)>
-<!ATTLIST partition action (create|delete|use_existing) "create">
+<!ATTLIST slice in_zpool CDATA #IMPLIED>
+<!ATTLIST slice in_vdev CDATA #IMPLIED>
<!--
- A partition name is a numeric value, e.g. 1, will be
- interpreted as partition 1. If a name is not provided
- the user must specify the use_existing action, otherwise
- this will be an invalid specification.
+ If the slice is to be used for swap, set is_swap to true.
-->
-<!ATTLIST partition name CDATA #IMPLIED>
-<!ATTLIST partition part_type CDATA "191">
+<!ATTLIST slice is_swap (true|false) "false">
<!--
- Size must be suffixed with a size unit. i.e 100gb, 2secs, 2tb.
+ The val attribute of size must be suffixed with a size unit.
+ e.g. 100gb, 2secs, 2tb.
-->
<!ELEMENT size EMPTY>
<!ATTLIST size val CDATA #REQUIRED>
<!ATTLIST size start_sector CDATA #IMPLIED>
-
-<!ELEMENT options (#PCDATA)>
-
<!--
- Option elements allow any string type, and this string is parsable
- character data, should the application require it.
--->
-
-<!--
- Filesystem options are for zfs filesystems. The format of these
- is this: "-o property=value". Any editable ZFS filesystem property
- can be set at creation time. Multiple -o options can be
- specified. An error will occur if a propert is specified in
- multiple -o options.
--->
-
-<!ELEMENT filesystem (options?)>
-<!ATTLIST filesystem name CDATA #REQUIRED>
-<!ATTLIST filesystem action (create|delete|preserve) "create">
-<!ATTLIST filesystem mountpoint CDATA #IMPLIED>
-
-<!--
- Redundancy needs to be part of the vdev grouping,
- not a property on zpool itself. There can be multiple
- vdev groupings within one pool configuration.
--->
-
-<!ELEMENT zpool (vdev*, dataset*, pool_options?, dataset_options?)>
-<!ATTLIST zpool action (create|delete|preserve|use_existing) "create">
-<!ATTLIST zpool name CDATA #REQUIRED>
-<!ATTLIST zpool is_root (true|false) "false">
-
-<!--
- The pool option string, which is also a parsable string,
- can include both pool options and filesystem options.
- For pool options the format is: "-o property=value". For
- filesystem properties the format is: "-O file-system-property=value"
- Both of these typs of properties can be set in the option string.
- An example of combining these in the option string:
-
-"-o altroot=/a -o autoexpand=off -o delegation=off -O atime=on -O compression=lzbj"
--->
-
-<!ELEMENT pool_options (options)>
-<!ELEMENT dataset_options (options)>
-
-
-<!ELEMENT zvol (options?, size) >
-<!ATTLIST zvol action (create|delete|preserve|use_existing) "create">
-<!ATTLIST zvol name CDATA #REQUIRED>
-
-<!--
- ISCSI does not have an action attribute. We use iscsi devices but
- we do not operate directly on them.
+ iscsi does not have an action attribute. We use iSCSI devices but
+ we do not operate directly on them.
-->
<!ELEMENT iscsi (ip)>
<!ATTLIST iscsi name CDATA #REQUIRED>
@@ -185,12 +142,87 @@
<!ELEMENT ip (#PCDATA)>
+<!ELEMENT logical (zpool+)>
+<!ATTLIST logical noswap (true|false) "false">
+<!ATTLIST logical nodump (true|false) "false">
+
<!--
- Swap and dump are optional with Solaris install.
+ If zpools and/or vdevs are specified, then they must be associated
+ with disk_names, partitions or slices via the use of the in_zpool
+ and/or in_vdev attributes of those elements, described above.
+-->
+<!ELEMENT zpool (vdev*, filesystem*, zvol*, pool_options?, dataset_options?, be?)>
+<!ATTLIST zpool name CDATA #REQUIRED>
+<!ATTLIST zpool action (create|delete|preserve|use_existing) "create">
+<!ATTLIST zpool is_root (true|false) "false">
+<!ATTLIST zpool mountpoint CDATA #IMPLIED>
+
+<!--
+ The vdev name is purely used for matching the value of the in_vdev
+ attribute on disks, partitions or slices.
-->
+<!ELEMENT vdev EMPTY>
+<!ATTLIST vdev name CDATA #REQUIRED>
+
+<!--
+ Redundancy needs to be part of the vdev grouping,
+ not a property on zpool itself. There can be multiple
+ vdev groupings within one pool configuration.
+-->
+<!ATTLIST vdev redundancy (mirror|raidz|raidz1|raidz2|raidz3|spare|log|cache|logmirror|none) "mirror">
+
+<!--
+ Filesystem options are for zfs filesystems. The format of these
+ is this: -o property=value. Any editable ZFS filesystem property
+ can be set at creation time. Multiple -o options can be
+ specified. An error will occur if a property is specified in
+ multiple -o options.
-<!ELEMENT swap (zvol)>
-<!ATTLIST swap no_swap (true|false) "false">
+ If a filesystem has the in_be attribute set to "true" then that
+ dataset will be created within the BE rather than as a shared
+ dataset. These filesystems require a full "path" name instead of
+ a Filesystem name. e.g. "/opt" or "/var" instead of "export/home"
+-->
+<!ELEMENT filesystem (options?)>
+<!ATTLIST filesystem name CDATA #REQUIRED>
+<!ATTLIST filesystem action (create|delete|preserve) "create">
+<!ATTLIST filesystem mountpoint CDATA #IMPLIED>
+<!ATTLIST filesystem in_be (true|false) "false">
+
+<!ELEMENT zvol (options?, size) >
+<!ATTLIST zvol action (create|delete|preserve|use_existing) "create">
+<!ATTLIST zvol name CDATA #REQUIRED>
+<!--
+ If the zvol is to be used as a swap device, set use to swap.
+ If the zvol is to be used as a dump device, set use to dump.
+-->
+<!ATTLIST zvol use (none|swap|dump) "none">
-<!ELEMENT dump (zvol)>
-<!ATTLIST dump no_dump (true|false) "false">
+<!--
+ Option elements allow any string type, and this string is
+ parsable character data, should the application require it.
+-->
+<!ELEMENT options (#PCDATA)>
+
+<!--
+ The pool_options string, which is also a parsable string, can include both
+ pool options and filesystem options.
+
+ For pool options the format is: -o property=value
+
+ For filesystem properties the format is: -O file-system-property=value
+
+ Both of these types of properties can be set in the option string.
+ For example:
+
+-o altroot=/a -o autoexpand=off -o delegation=off -O atime=on -O compression=lzbj
+-->
+<!ELEMENT pool_options (options)>
+<!ELEMENT dataset_options (options)>
+
+<!--
+ The be element is used to control the name of the BE created by
+ consumers. If not specified, it defaults to solaris
+-->
+<!ELEMENT be EMPTY>
+<!ATTLIST be name CDATA #REQUIRED>
--- a/usr/src/lib/install_target/test/test_shadow_list.py Wed Apr 13 20:00:11 2011 -0700
+++ b/usr/src/lib/install_target/test/test_shadow_list.py Thu Apr 14 09:56:06 2011 -0600
@@ -1470,8 +1470,9 @@
# find the list of vdevs that compose the 'rpool' zpool
rpool_map = _get_vdev_mapping("rpool")
- # find the first slice that makes up the 'root' vdev of the pool
- self.in_use_slice = rpool_map["root"][0]
+ # take the first key in the rpool_map and use the first slice that
+ # makes up that key's mapping
+ self.in_use_slice = rpool_map[rpool_map.keys()[0]][0]
(self.ctd, _none, self.index) = \
self.in_use_slice.split("/")[-1].partition("s")
--- a/usr/src/lib/install_target/test/test_target_manifest.py Wed Apr 13 20:00:11 2011 -0700
+++ b/usr/src/lib/install_target/test/test_target_manifest.py Thu Apr 14 09:56:06 2011 -0600
@@ -30,6 +30,7 @@
NOTE: If you want to change which XML file is tested, simply update the
MANIFEST variable
"""
+import os.path
import unittest
import solaris_install.target
@@ -39,8 +40,9 @@
from solaris_install.data_object import ParsingError
from solaris_install.data_object.cache import DataObjectCache
-MANIFEST = "test_target_manifest.xml"
-INVALID_MANIFEST = "test_invalid_manifest.xml"
+TEST_DIR = os.path.dirname(os.path.abspath(__file__))
+MANIFEST = "%s/test_target_manifest.xml" % TEST_DIR
+INVALID_MANIFEST = "%s/test_invalid_manifest.xml" % TEST_DIR
class TestTargetManfiest(unittest.TestCase):
--- a/usr/src/lib/install_transfer/info.py Wed Apr 13 20:00:11 2011 -0700
+++ b/usr/src/lib/install_transfer/info.py Thu Apr 14 09:56:06 2011 -0600
@@ -291,18 +291,15 @@
def to_xml(self):
'''Method to create the xml image element'''
element = etree.Element(Image.IMAGE_LABEL)
- try:
- arg_info = self.get_children("args")[0]
- except ObjectNotFoundError:
- arg_info = None
- if arg_info is not None:
- if Image.IMAGE_SSL_KEY_LABEL in arg_info.arg_dict:
+ arg_info = self.get_children(Args.ARGS_LABEL)
+ if arg_info:
+ if Image.IMAGE_SSL_KEY_LABEL in arg_info[0].arg_dict:
element.set(Image.IMAGE_SSL_KEY_LABEL,
- arg_info.arg_dict[Image.IMAGE_SSL_KEY_LABEL])
- if Image.IMAGE_SSL_CERT_LABEL in arg_info.arg_dict:
+ arg_info[0].arg_dict[Image.IMAGE_SSL_KEY_LABEL])
+ if Image.IMAGE_SSL_CERT_LABEL in arg_info[0].arg_dict:
element.set(Image.IMAGE_SSL_CERT_LABEL,
- arg_info.arg_dict[Image.IMAGE_SSL_CERT_LABEL])
+ arg_info[0].arg_dict[Image.IMAGE_SSL_CERT_LABEL])
element.set(Image.IMAGE_IMG_ROOT_LABEL, self.img_root)
element.set(Image.IMAGE_ACTION_LABEL, self.action)
element.set(Image.IMAGE_INDEX_LABEL, str(self.index))