Esempio n. 1
0
    def _get_source_xml(self):
        if not self.host:
            raise RuntimeError(_("Hostname is required"))
        if not self.source_path:
            raise RuntimeError(_("Host path is required"))

        iqn_xml = ""
        if self.iqn:
            iqn_xml += """    <initiator>\n"""
            iqn_xml += """      <iqn name="%s"/>\n""" % escape(self.iqn)
            iqn_xml += """    </initiator>\n"""

        xml  = """    <host name="%s"/>\n""" % self.host
        xml += """    <device path="%s"/>\n""" % escape(self.source_path)
        xml += iqn_xml

        return xml
Esempio n. 2
0
 def _get_source_xml(self):
     if not self.host:
         raise RuntimeError(_("Hostname is required"))
     if not self.source_path:
         raise RuntimeError(_("Host path is required"))
     xml = """    <host name="%s"/>\n""" % self.host + \
           """    <device path="%s"/>\n""" % escape(self.source_path)
     return xml
Esempio n. 3
0
 def _get_source_xml(self):
     if not self.host:
         raise RuntimeError(_("Hostname is required"))
     if not self.source_path:
         raise RuntimeError(_("Host path is required"))
     xml = """    <format type="%s"/>\n""" % self.format + \
           """    <host name="%s"/>\n""" % self.host + \
           """    <dir path="%s"/>\n""" % escape(self.source_path)
     return xml
Esempio n. 4
0
    def _get_source_xml(self):
        if not self.source_path:
            raise RuntimeError(_("Host path is required"))

        xml = ""
        # There is no explicit "auto" type for disk pools, but leaving out
        # the format type seems to do the job for existing formatted disks
        if self.format != "auto":
            xml = """    <format type="%s"/>\n""" % self.format
        xml += """    <device path="%s"/>\n""" % escape(self.source_path)
        return xml
Esempio n. 5
0
    def _get_source_xml(self):
        if not self.source_path:
            raise RuntimeError(_("Host path is required"))

        xml = ""
        # There is no explicit "auto" type for disk pools, but leaving out
        # the format type seems to do the job for existing formatted disks
        if self.format != "auto":
            xml = """    <format type="%s"/>\n""" % self.format
        xml += """    <device path="%s"/>\n""" % escape(self.source_path)
        return xml
Esempio n. 6
0
 def _get_source_xml(self):
     if not self.source_path:
         raise RuntimeError(_("Adapter name is required"))
     xml = """    <adapter name="%s"/>\n""" % escape(self.source_path)
     return xml
Esempio n. 7
0
 def _get_target_xml(self):
     xml = "    <path>%s</path>\n" % escape(self.target_path)
     return xml
Esempio n. 8
0
 def _get_target_xml(self):
     xml = "    <path>%s</path>\n" % escape(self.target_path) + \
           "%s" % self._get_perms_xml()
     return xml
Esempio n. 9
0
 def _get_source_xml(self):
     if not self.source_path:
         raise RuntimeError(_("Device path is required"))
     xml = "    <format type='%s'/>\n" % self.format + \
           "    <device path='%s'/>\n" % escape(self.source_path)
     return xml
Esempio n. 10
0
 def _get_target_xml(self):
     xml = "    <path>%s</path>\n" % escape(self.target_path)
     return xml
Esempio n. 11
0
 def _get_source_xml(self):
     if not self.source_path:
         raise RuntimeError(_("Adapter name is required"))
     xml = """    <adapter name="%s"/>\n""" % escape(self.source_path)
     return xml
Esempio n. 12
0
 def _get_target_xml(self):
     xml = "    <path>%s</path>\n" % escape(self.target_path) + \
           "%s" % self._get_perms_xml()
     return xml
Esempio n. 13
0
 def _get_source_xml(self):
     if not self.source_path:
         raise RuntimeError(_("Device path is required"))
     xml = "    <format type='%s'/>\n" % self.format + \
           "    <device path='%s'/>\n" % escape(self.source_path)
     return xml