/[smeserver]/cdrom.image/sme9/updates/storage/partspec.py
ViewVC logotype

Annotation of /cdrom.image/sme9/updates/storage/partspec.py

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (hide annotations) (download) (as text)
Sun Dec 22 04:27:51 2013 UTC (10 years, 7 months ago) by wellsi
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +0 -0 lines
Content type: text/x-python
FILE REMOVED
anaconda updates now handled via patches

1 charliebrady 1.1 # partspec.py
2     #
3     # Copyright (C) 2009 Red Hat, Inc.
4     #
5     # This copyrighted material is made available to anyone wishing to use,
6     # modify, copy, or redistribute it subject to the terms and conditions of
7     # the GNU General Public License v.2, or (at your option) any later version.
8     # This program is distributed in the hope that it will be useful, but WITHOUT
9     # ANY WARRANTY expressed or implied, including the implied warranties of
10     # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11     # Public License for more details. You should have received a copy of the
12     # GNU General Public License along with this program; if not, write to the
13     # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
14     # 02110-1301, USA. Any Red Hat trademarks that are incorporated in the
15     # source code or documentation are not subject to the GNU General Public
16     # License and may only be used or replicated with the express permission of
17     # Red Hat, Inc.
18     #
19     # Red Hat Author(s): Chris Lumens <clumens@redhat.com>
20     #
21    
22     class PartSpec(object):
23     def __init__(self, mountpoint=None, fstype=None, size=None, maxSize=None,
24     grow=False, asVol=False, singlePV=False, weight=0,
25 charliebrady 1.2 requiredSpace=0, useRAID=False):
26 charliebrady 1.1 """ Create a new storage specification. These are used to specify
27     the default partitioning layout as an object before we have the
28     storage system up and running. The attributes are obvious
29     except for the following:
30    
31     asVol -- Should this be allocated as a logical volume? If not,
32     it will be allocated as a partition.
33     singlePV -- Should this logical volume map to a single physical
34     volume in the volume group? Implies asVol=True
35     weight -- An integer that modifies the sort algorithm for partition
36     requests. A larger value means the partition will end up
37     closer to the front of the disk. This is mainly used to
38     make sure /boot ends up in front, and any special (PReP,
39     appleboot, etc.) partitions end up in front of /boot.
40     This value means nothing if asVol=False.
41     requiredSpace -- This value is only taken into account if
42     asVol=True, and specifies the size in MB that the
43     containing VG must be for this PartSpec to even
44     get used. The VG's size is calculated before any
45     other LVs are created inside it. If not enough
46     space exists, this PartSpec will never get turned
47     into an LV.
48 charliebrady 1.2 useRAID -- Should a RAID1 array be created for this volume? If
49     not, it will be allocated as a partition.
50 charliebrady 1.1 """
51    
52     self.mountpoint = mountpoint
53     self.fstype = fstype
54     self.size = size
55     self.maxSize = maxSize
56     self.grow = grow
57     self.asVol = asVol
58     self.singlePV = singlePV
59     self.weight = weight
60     self.requiredSpace = requiredSpace
61 charliebrady 1.2 self.useRAID = useRAID
62 charliebrady 1.1
63     if self.singlePV and not self.asVol:
64     self.asVol = True
65    
66     def __str__(self):
67     s = ("%(type)s instance (%(id)s) -- \n"
68     " mountpoint = %(mountpoint)s asVol = %(asVol)s singlePV = %(singlePV)s\n"
69     " weight = %(weight)s fstype = %(fstype)s\n"
70     " size = %(size)s maxSize = %(maxSize)s grow = %(grow)s\n" %
71     {"type": self.__class__.__name__, "id": "%#x" % id(self),
72     "mountpoint": self.mountpoint, "asVol": self.asVol,
73     "singlePV": self.singlePV, "weight": self.weight,
74     "fstype": self.fstype, "size": self.size,
75     "maxSize": self.maxSize, "grow": self.grow})
76    
77     return s

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed