summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2014-02-06 11:04:15 (GMT)
committerDavid Cantrell <dcantrell@redhat.com>2014-02-06 11:04:15 (GMT)
commit213f814b94c553afe7d878e31b319154c8f7bf6b (patch)
treeb5b3cc2b1e72878c8f0825c7c1e72121eb312b49
parent534a5125fff69aabe63b418c405e48ba4fef63af (diff)
downloadpyparted-master.zip
pyparted-master.tar.gz
pyparted-master.tar.xz
Teach pyparted that aarch64 support GPT partitions.HEADmaster
The parted parttion table type structure does not recognize GPT tables for aarch64.
-rw-r--r--src/parted/__init__.py7
-rwxr-xr-xtests/test_parted_parted.py1
2 files changed, 5 insertions, 3 deletions
diff --git a/src/parted/__init__.py b/src/parted/__init__.py
index 799f540..75b90d6 100644
--- a/src/parted/__init__.py
+++ b/src/parted/__init__.py
@@ -285,7 +285,8 @@ archLabels = {'i386': ['msdos', 'gpt'],
'sparc': ['sun'],
'ia64': ['msdos', 'gpt'],
'ppc': ['msdos', 'mac', 'amiga', 'gpt'],
- 'x86_64': ['msdos', 'gpt']}
+ 'x86_64': ['msdos', 'gpt'],
+ 'aarch64': ['msdos', 'gpt']}
# Adapted from:
# http://stackoverflow.com/questions/922550/how-to-mark-a-global-as-deprecated-in-python
@@ -322,9 +323,9 @@ def Deprecated(mod, deprecated=None):
__archLabels = (('amiga', 'ppc(64)?$'),
('bsd', 'alpha$'),
('dasd', 's390x?$'),
- ('gpt', 'i[3-6]86$|x86_64$|ia64$|ppc(64)?$'),
+ ('gpt', 'i[3-6]86$|x86_64$|ia64$|ppc(64)?$|aarch64$'),
('mac', 'ppc(64)?$'),
- ('msdos', 'i[3-6]86$|x86_64$|s390x?$|alpha$|ia64$|ppc(64)?$'),
+ ('msdos', 'i[3-6]86$|x86_64$|s390x?$|alpha$|ia64$|ppc(64)?$|aarch64$'),
('sun', 'sparc(64)?$'))
def getLabels(arch=None):
diff --git a/tests/test_parted_parted.py b/tests/test_parted_parted.py
index b9eb87c..5b546d0 100755
--- a/tests/test_parted_parted.py
+++ b/tests/test_parted_parted.py
@@ -59,6 +59,7 @@ class GetLabelsTestCase(unittest.TestCase):
self.assertSetEqual(parted.getLabels('ppc64'), {'amiga', 'gpt', 'mac', 'msdos'})
self.assertSetEqual(parted.getLabels('alpha'), {'bsd', 'msdos'})
self.assertSetEqual(parted.getLabels('ia64'), {'gpt', 'msdos'})
+ self.assertSetEqual(parted.getLabels('aarch64'), {'gpt', 'msdos'})
class GetDeviceTestCase(RequiresDeviceNode):
def runTest(self):