Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions cfbs/cfbs_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
from collections import OrderedDict
from copy import deepcopy
import logging as log
from typing import Optional

from cfbs.index import Index
from cfbs.pretty import pretty, TOP_LEVEL_KEYS, MODULE_KEYS
from cfbs.utils import CFBSValidationError, read_json, CFBSExitError


def _construct_provided_module(name, data, url, commit, added_by="cfbs add"):
def _construct_provided_module(name, data, url, commit, added_by):
# At this point the @commit part should be removed from url so:
# either url should not have an @,
# or the @ should be for user@host.something
Expand Down Expand Up @@ -47,7 +48,8 @@ def _construct_provided_module(name, data, url, commit, added_by="cfbs add"):
"missing required key 'steps' in module definition: %s" % pretty(data)
)
module["steps"] = data["steps"]
module["added_by"] = added_by
if added_by is not None:
module["added_by"] = added_by
return module


Expand Down Expand Up @@ -172,7 +174,7 @@ def __getitem__(self, key):
def __contains__(self, key):
return key in self._data

def get_provides(self, added_by="cfbs add"):
def get_provides(self, added_by: Optional[str]):
modules = OrderedDict()
assert self._data is not None
if "provides" not in self._data:
Expand Down
2 changes: 1 addition & 1 deletion cfbs/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ def update_command(to_update):
)

module_name = old_module["name"]
provides = remote_config.get_provides()
provides = remote_config.get_provides(old_module.get("added_by"))

if not module_name or module_name not in provides:
continue
Expand Down