mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Fallback values in a prettier way
This commit is contained in:
parent
83e1339145
commit
8b5bc77650
3 changed files with 4 additions and 12 deletions
|
@ -29,9 +29,7 @@ class GPTPartitionMap(AbstractPartitionMap):
|
||||||
for partition in self.partitions:
|
for partition in self.partitions:
|
||||||
partition.create(volume)
|
partition.create(volume)
|
||||||
|
|
||||||
boot_idx = self.root.get_index()
|
boot_idx = getattr(self, 'boot', self.root).get_index()
|
||||||
if hasattr(self, 'boot'):
|
|
||||||
boot_idx = self.boot.get_index()
|
|
||||||
log_check_call(['/sbin/parted', '--script', volume.device_path,
|
log_check_call(['/sbin/parted', '--script', volume.device_path,
|
||||||
'--', 'set ' + str(boot_idx) + ' boot on'])
|
'--', 'set ' + str(boot_idx) + ' boot on'])
|
||||||
log_check_call(['/sbin/parted', '--script', volume.device_path,
|
log_check_call(['/sbin/parted', '--script', volume.device_path,
|
||||||
|
|
|
@ -32,8 +32,6 @@ class MBRPartitionMap(AbstractPartitionMap):
|
||||||
for partition in self.partitions:
|
for partition in self.partitions:
|
||||||
partition.create(volume)
|
partition.create(volume)
|
||||||
|
|
||||||
boot_idx = self.root.get_index()
|
boot_idx = getattr(self, 'boot', self.root).get_index()
|
||||||
if hasattr(self, 'boot'):
|
|
||||||
boot_idx = self.boot.get_index()
|
|
||||||
log_check_call(['/sbin/parted', '--script', volume.device_path,
|
log_check_call(['/sbin/parted', '--script', volume.device_path,
|
||||||
'--', 'set ' + str(boot_idx) + ' boot on'])
|
'--', 'set ' + str(boot_idx) + ' boot on'])
|
||||||
|
|
|
@ -10,14 +10,10 @@ class PackageList(object):
|
||||||
self.local = set()
|
self.local = set()
|
||||||
if 'remote' in data:
|
if 'remote' in data:
|
||||||
for package in data['remote']:
|
for package in data['remote']:
|
||||||
target = None
|
|
||||||
if isinstance(package, dict):
|
if isinstance(package, dict):
|
||||||
name = package['name']
|
self.add(package['name'], package.get('target', None))
|
||||||
if 'target' in package:
|
|
||||||
target = package['target']
|
|
||||||
else:
|
else:
|
||||||
name = package
|
self.add(package, None)
|
||||||
self.add(name, target)
|
|
||||||
if 'local' in data:
|
if 'local' in data:
|
||||||
for package_path in data['local']:
|
for package_path in data['local']:
|
||||||
self.local.add(package_path)
|
self.local.add(package_path)
|
||||||
|
|
Loading…
Add table
Reference in a new issue