D'OH
This commit is contained in:
parent
799ef58667
commit
9e5ff48926
16
aif.xsd
16
aif.xsd
@ -466,23 +466,23 @@
|
|||||||
<xs:attribute name="name" type="aif:t_nonempty" use="required"/>
|
<xs:attribute name="name" type="aif:t_nonempty" use="required"/>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
<xs:unique name="uniq_vg_tags">
|
<xs:unique name="uniq_vg_tags">
|
||||||
<xs:selector xpath="tags"/>
|
<xs:selector xpath="aif:tags"/>
|
||||||
<xs:field xpath="tag"/>
|
<xs:field xpath="tag"/>
|
||||||
</xs:unique>
|
</xs:unique>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
<xs:unique name="uniq_vg_names">
|
<xs:unique name="uniq_vg_names">
|
||||||
<xs:selector xpath="volumeGroup"/>
|
<xs:selector xpath="aif:volumeGroup"/>
|
||||||
<xs:field xpath="@name"/>
|
<xs:field xpath="@name"/>
|
||||||
</xs:unique>
|
</xs:unique>
|
||||||
<!-- ??? doesn't seem to work. -->
|
<!-- ??? doesn't seem to work. -->
|
||||||
<xs:unique name="uniq_vg_lv">
|
<xs:unique name="uniq_vg_lv">
|
||||||
<xs:selector xpath="volumeGroup/logicalVolumes/lv"/>
|
<xs:selector xpath=".//aif:lv"/>
|
||||||
<xs:field xpath="@name"/>
|
<xs:field xpath="@name"/>
|
||||||
</xs:unique>
|
</xs:unique>
|
||||||
<xs:unique name="uniq_vg_pv">
|
<xs:unique name="uniq_vg_pv">
|
||||||
<xs:selector xpath="pv"/>
|
<xs:selector xpath=".//aif:pv"/>
|
||||||
<xs:field xpath="@source"/>
|
<xs:field xpath="@source"/>
|
||||||
</xs:unique>
|
</xs:unique>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
@ -518,7 +518,7 @@
|
|||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
<xs:unique name="uniq_array_name">
|
<xs:unique name="uniq_array_name">
|
||||||
<xs:selector xpath="array"/>
|
<xs:selector xpath="aif:array"/>
|
||||||
<xs:field xpath="@name"/>
|
<xs:field xpath="@name"/>
|
||||||
</xs:unique>
|
</xs:unique>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
@ -586,11 +586,11 @@
|
|||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
<xs:unique name="uniq_ip4">
|
<xs:unique name="uniq_ip4">
|
||||||
<xs:selector xpath="ipv4"/>
|
<xs:selector xpath="aif:ipv4"/>
|
||||||
<xs:field xpath="address"/>
|
<xs:field xpath="address"/>
|
||||||
</xs:unique>
|
</xs:unique>
|
||||||
<xs:unique name="uniq_ip6">
|
<xs:unique name="uniq_ip6">
|
||||||
<xs:selector xpath="ipv6"/>
|
<xs:selector xpath="aif:ipv6"/>
|
||||||
<xs:field xpath="address"/>
|
<xs:field xpath="address"/>
|
||||||
</xs:unique>
|
</xs:unique>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
@ -606,7 +606,7 @@
|
|||||||
<xs:attribute name="device" type="aif:t_iface" use="required"/>
|
<xs:attribute name="device" type="aif:t_iface" use="required"/>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
<xs:unique name="uniq_resolver">
|
<xs:unique name="uniq_resolver">
|
||||||
<xs:selector xpath="resolvers"/>
|
<xs:selector xpath="aif:resolvers"/>
|
||||||
<xs:field xpath="resolver"/>
|
<xs:field xpath="resolver"/>
|
||||||
</xs:unique>
|
</xs:unique>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
@ -146,7 +146,7 @@ class LocalFile(Config):
|
|||||||
def __init__(self, path, xsd_path = None, *args, **kwargs):
|
def __init__(self, path, xsd_path = None, *args, **kwargs):
|
||||||
super().__init__(xsd_path = xsd_path, *args, **kwargs)
|
super().__init__(xsd_path = xsd_path, *args, **kwargs)
|
||||||
self.type = 'local'
|
self.type = 'local'
|
||||||
self.source = _patterns['local'].search(path).group('path')
|
self.source = path
|
||||||
|
|
||||||
def fetch(self):
|
def fetch(self):
|
||||||
self.source = os.path.realpath(self.source)
|
self.source = os.path.realpath(self.source)
|
||||||
|
@ -2,4 +2,4 @@ from . import block
|
|||||||
from . import filesystem
|
from . import filesystem
|
||||||
from . import luks
|
from . import luks
|
||||||
from . import lvm
|
from . import lvm
|
||||||
from . import mdadm
|
from . import mdadm
|
||||||
|
@ -4,10 +4,10 @@ import subprocess
|
|||||||
##
|
##
|
||||||
import psutil
|
import psutil
|
||||||
##
|
##
|
||||||
from aif.disk.block import Partition
|
import aif.disk.block
|
||||||
from aif.disk.luks import LUKS
|
import aif.disk.luks
|
||||||
from aif.disk.lvm import LV as LVMVolume
|
import aif.disk.lvm
|
||||||
from aif.disk.mdadm import Array as MDArray
|
import aif.disk.mdadm
|
||||||
|
|
||||||
# I wish there was a better way of doing this.
|
# I wish there was a better way of doing this.
|
||||||
# https://unix.stackexchange.com/a/98680
|
# https://unix.stackexchange.com/a/98680
|
||||||
@ -44,7 +44,11 @@ for i in os.listdir(_mod_dir):
|
|||||||
class FS(object):
|
class FS(object):
|
||||||
def __init__(self, fs_xml, sourceobj):
|
def __init__(self, fs_xml, sourceobj):
|
||||||
self.xml = fs_xml
|
self.xml = fs_xml
|
||||||
if not isinstance(sourceobj, (Partition, LUKS, LVMVolume, MDArray)):
|
if not isinstance(sourceobj, (aif.disk.block.Disk,
|
||||||
|
aif.disk.block.Partition,
|
||||||
|
aif.disk.luks.LUKS,
|
||||||
|
aif.disk.lvm.LV,
|
||||||
|
aif.disk.mdadm.Array)):
|
||||||
raise ValueError(('sourceobj must be of type '
|
raise ValueError(('sourceobj must be of type '
|
||||||
'aif.disk.block.Partition, '
|
'aif.disk.block.Partition, '
|
||||||
'aif.disk.luks.LUKS, '
|
'aif.disk.luks.LUKS, '
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from aif.disk.block import Disk, Partition
|
import aif.disk.block
|
||||||
from aif.disk.lvm import LV
|
import aif.disk.lvm
|
||||||
from aif.disk.mdadm import Array
|
import aif.disk.mdadm
|
||||||
|
|
||||||
|
|
||||||
class LUKS(object):
|
class LUKS(object):
|
||||||
def __init__(self, partobj):
|
def __init__(self, partobj):
|
||||||
|
@ -7,9 +7,9 @@ except ImportError:
|
|||||||
import subprocess
|
import subprocess
|
||||||
has_mod = False
|
has_mod = False
|
||||||
##
|
##
|
||||||
from aif.disk.block import Disk, Partition
|
import aif.disk.block
|
||||||
from aif.disk.luks import LUKS
|
import aif.disk.luks
|
||||||
from aif.disk.mdadm import Array
|
import aif.disk.mdadm
|
||||||
|
|
||||||
|
|
||||||
class PV(object):
|
class PV(object):
|
||||||
|
@ -7,9 +7,9 @@ import uuid
|
|||||||
##
|
##
|
||||||
import mdstat
|
import mdstat
|
||||||
##
|
##
|
||||||
from aif.disk.block import Disk, Partition
|
import aif.disk.block
|
||||||
from aif.disk.luks import LUKS
|
import aif.disk.luks
|
||||||
from aif.disk.lvm import LV
|
import aif.disk.lvm
|
||||||
|
|
||||||
|
|
||||||
SUPPORTED_LEVELS = (0, 1, 4, 5, 6, 10)
|
SUPPORTED_LEVELS = (0, 1, 4, 5, 6, 10)
|
||||||
@ -50,7 +50,11 @@ class Member(object):
|
|||||||
def __init__(self, member_xml, partobj):
|
def __init__(self, member_xml, partobj):
|
||||||
self.xml = member_xml
|
self.xml = member_xml
|
||||||
self.device = partobj
|
self.device = partobj
|
||||||
if not isinstance(self.device, (Partition, Disk, Array)):
|
if not isinstance(self.device, (aif.disk.block.Partition,
|
||||||
|
aif.disk.block.Disk,
|
||||||
|
aif.disk.mdadm.Array,
|
||||||
|
aif.disk.lvm.LV,
|
||||||
|
aif.disk.luks.LUKS)):
|
||||||
raise ValueError(('partobj must be of type aif.disk.block.Partition, '
|
raise ValueError(('partobj must be of type aif.disk.block.Partition, '
|
||||||
'aif.disk.block.Disk, or aif.disk.mdadm.Array'))
|
'aif.disk.block.Disk, or aif.disk.mdadm.Array'))
|
||||||
self.devpath = self.device.devpath
|
self.devpath = self.device.devpath
|
||||||
|
@ -67,14 +67,6 @@
|
|||||||
<lv id="lv1" name="logical1" size="100%"/>
|
<lv id="lv1" name="logical1" size="100%"/>
|
||||||
</logicalVolumes>
|
</logicalVolumes>
|
||||||
</volumeGroup>
|
</volumeGroup>
|
||||||
<volumeGroup id="vg2" name="group2">
|
|
||||||
<physicalVolumes>
|
|
||||||
<pv id="pv2" source="lvm_member1"/>
|
|
||||||
</physicalVolumes>
|
|
||||||
<logicalVolumes>
|
|
||||||
<lv id="lv2" name="logical1" size="100%"/>
|
|
||||||
</logicalVolumes>
|
|
||||||
</volumeGroup>
|
|
||||||
</lvm>
|
</lvm>
|
||||||
<mdadm>
|
<mdadm>
|
||||||
<!-- level can be 0, 1, 4, 5, 6, or 10. RAID 1+0 (which is different from mdadm RAID10) would be done by
|
<!-- level can be 0, 1, 4, 5, 6, or 10. RAID 1+0 (which is different from mdadm RAID10) would be done by
|
||||||
|
Loading…
Reference in New Issue
Block a user