code
stringlengths
3
6.57k
doc.createElement('UserPassword')
doc.createTextNode('Admin@storage')
password.appendChild(password_text)
storage.appendChild(password)
doc.createElement('Product')
doc.createTextNode('V3')
product.appendChild(product_text)
storage.appendChild(product)
doc.createElement('Protocol')
doc.createTextNode('iSCSI')
protocol.appendChild(protocol_text)
storage.appendChild(protocol)
doc.createElement('LUN')
config.appendChild(lun)
doc.createElement('LUNType')
doc.createTextNode('Thick')
luntype.appendChild(luntype_text)
lun.appendChild(luntype)
doc.createElement('LUNReadyWaitInterval')
doc.createTextNode('2')
lun_ready_wait_interval.appendChild(lun_ready_wait_interval_text)
lun.appendChild(lun_ready_wait_interval)
doc.createElement('LUNcopyWaitInterval')
doc.createTextNode('2')
lun_copy_wait_interval.appendChild(lun_copy_wait_interval_text)
lun.appendChild(lun_copy_wait_interval)
doc.createElement('Timeout')
doc.createTextNode('43200')
timeout.appendChild(timeout_text)
lun.appendChild(timeout)
doc.createElement('WriteType')
doc.createTextNode('1')
write_type.appendChild(write_type_text)
lun.appendChild(write_type)
doc.createElement('MirrorSwitch')
doc.createTextNode('1')
mirror_switch.appendChild(mirror_switch_text)
lun.appendChild(mirror_switch)
doc.createElement('Prefetch')
prefetch.setAttribute('Type', '1')
prefetch.setAttribute('Value', '0')
lun.appendChild(prefetch)
doc.createElement('StoragePool')
doc.createTextNode('OpenStack_Pool')
pool.appendChild(pool_text)
lun.appendChild(pool)
doc.createElement('iSCSI')
config.appendChild(iscsi)
doc.createElement('DefaultTargetIP')
doc.createTextNode('192.0.2.68')
defaulttargetip.appendChild(defaulttargetip_text)
iscsi.appendChild(defaulttargetip)
doc.createElement('Initiator')
initiator.setAttribute('Name', 'iqn.1993-08.debian:01:ec2bff7ac3a3')
initiator.setAttribute('TargetIP', '192.0.2.2')
initiator.setAttribute('CHAPinfo', 'mm-user;mm-user@storage')
initiator.setAttribute('ALUA', '1')
initiator.setAttribute('TargetPortGroup', 'PortGroup001')
iscsi.appendChild(initiator)
open(self.conf.cinder_huawei_conf_file, 'w')
fakefile.write(doc.toprettyxml(indent='')
fakefile.close()
Copyright (c)
TODO(joi)
PresubmitFailure(Exception)
CommandData(object)
__init__(self, name, cmd, kwargs, message)
normpath(path)
path.replace(os.sep, '/')
os.path.normpath(path)
_RightHandSideLinesImpl(affected_files)
af.ChangedContents()
yield (af, line[0], line[1])
PresubmitOutput(object)
__init__(self, input_stream=None, output_stream=None)
prompt_yes_no(self, prompt_string)
self.write(prompt_string)
self.input_stream.readline()
strip()
lower()
in ('y', 'yes')
self.fail()
self.fail()
fail(self)
should_continue(self)
write(self, s)
self.written_output.append(s)
self.output_stream.write(s)
getvalue(self)
join(self.written_output)
_PresubmitResult(object)
__init__(self, message, items=None, long_text='')
long_text.rstrip()
handle(self, output)
output.write(self._message)
output.write('\n')
enumerate(self._items)
output.write(' ')
output.write(str(item)
len(self._items)