Skip to content

Commit

Permalink
Merge pull request #7 from freenas/FIX-39258
Browse files Browse the repository at this point in the history
Allow overriding branch for plugin fetching
  • Loading branch information
Brandon Schneider committed Aug 1, 2018
2 parents 39c6e4f + cda0a2b commit e0877d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions iocage/cli/fetch.py
Expand Up @@ -96,6 +96,8 @@ def validate_count(ctx, param, value):
help="Accept the plugin's LICENSE agreement.")
@click.option("--official", "-O", is_flag=True, default=False,
help="Lists only official plugins.")
@click.option("--branch", default=None,
help="Select a different plugin branch (for development)")
def cli(**kwargs):
"""CLI command that calls fetch_release()"""
release = kwargs.get("release", None)
Expand Down
13 changes: 9 additions & 4 deletions iocage/lib/iocage.py
Expand Up @@ -851,6 +851,7 @@ def fetch(self, **kwargs):
header = kwargs.pop("header", True)
_long = kwargs.pop("_long", False)
official = kwargs.pop("official", False)
branch = kwargs.pop("branch", None)

freebsd_version = ioc_common.checkoutput(["freebsd-version"])
arch = os.uname()[4]
Expand Down Expand Up @@ -880,8 +881,9 @@ def fetch(self, **kwargs):
]

if _list:
rel_list = ioc_plugin.IOCPlugin().fetch_plugin_index(
"", _list=True, list_header=header, list_long=_long,
rel_list = ioc_plugin.IOCPlugin(
branch=branch).fetch_plugin_index(
"", _list=True, list_header=header, list_long=_long,
icon=True, official=official)

return rel_list
Expand All @@ -904,6 +906,7 @@ def fetch(self, **kwargs):
ioc_plugin.IOCPlugin(
release=release,
plugin=name,
branch=branch,
exit_on_error=self.exit_on_error,
**kwargs).fetch_plugin_index(
props, accept_license=accept, official=official)
Expand All @@ -912,13 +915,15 @@ def fetch(self, **kwargs):

if count == 1:
ioc_plugin.IOCPlugin(
release=release, exit_on_error=self.exit_on_error,
release=release, branch=branch,
exit_on_error=self.exit_on_error,
silent=self.silent, **kwargs
).fetch_plugin(name, props, 0, accept)
else:
for j in range(1, count + 1):
ioc_plugin.IOCPlugin(
release=release, exit_on_error=self.exit_on_error,
release=release, branch=branch,
exit_on_error=self.exit_on_error,
silent=self.silent, **kwargs
).fetch_plugin(name, props, j, accept)
else:
Expand Down

0 comments on commit e0877d7

Please sign in to comment.