Fixed the lack of cycling through a list of given objects in @cpattr

This commit is contained in:
jamesvclemence 2009-01-23 17:49:04 +00:00
parent 3d4ad07f9a
commit 9820d28438

View file

@ -344,14 +344,12 @@ def cmd_cpattr(command):
# Does target exist? # Does target exist?
if not tar_obj: if not tar_obj:
session.msg("Target object does not exist: " + tar_string) session.msg("Target object does not exist: " + tar_string)
return
# If target attribute is not given, use source_attr_string for name # If target attribute is not given, use source_attr_string for name
if tar_attr_string == '': if tar_attr_string == '':
# session.msg("Testing")
src_attr_contents = src_obj.get_attribute_value(source_attr_string) src_attr_contents = src_obj.get_attribute_value(source_attr_string)
tar_obj.set_attribute(source_attr_string, src_attr_contents) tar_obj.set_attribute(source_attr_string, src_attr_contents)
return continue
# If however, the target attribute is given, check it exists and update accordingly # If however, the target attribute is given, check it exists and update accordingly
@ -363,13 +361,12 @@ def cmd_cpattr(command):
if not tar_attr: if not tar_attr:
src_attr_contents = src_obj.get_attribute_value(source_attr_string) src_attr_contents = src_obj.get_attribute_value(source_attr_string)
tar_obj.set_attribute(tar_attr_string, src_attr_contents) tar_obj.set_attribute(tar_attr_string, src_attr_contents)
return continue
# If target has attribute, update its contents # If target has attribute, update its contents
src_attr_contents = src_obj.get_attribute_value(source_attr_string) src_attr_contents = src_obj.get_attribute_value(source_attr_string)
tar_obj.set_attribute(tar_attr_string, src_attr_contents) tar_obj.set_attribute(tar_attr_string, src_attr_contents)
session.msg(tar_obj.get_attribute_value(source_attr_string)) continue
def cmd_nextfree(command): def cmd_nextfree(command):
""" """