Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Abstract retrieving plugin default props
Browse files Browse the repository at this point in the history
This commit abstracts retrieving plugin default props so that they can be retrieved separately from the fetching a plugin process.
  • Loading branch information
sonicaj committed Sep 18, 2019
1 parent 01c1240 commit d881986
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions iocage_lib/ioc_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ class IOCPlugin(object):
"""

PLUGIN_VERSION = '2'
DEFAULT_PROPS = {
'vnet': 1,
'boot': 1
}

def __init__(
self, release=None, jail=None, plugin=None, branch=None,
Expand Down Expand Up @@ -484,10 +488,8 @@ def __fetch_plugin_props__(self, conf, props, num):

# We set our properties that we need, and then iterate over the user
# supplied properties replacing ours.
create_props = [
f'release={release}', 'boot=on', 'vnet=1'
] + [
f'{k}={v}' for k, v in props.items()
create_props = [f'release={release}'] + [
f'{k}={v}' for k, v in {**self.DEFAULT_PROPS, **props}.items()
]

if all(
Expand Down

0 comments on commit d881986

Please sign in to comment.