Skip to content

Commit

Permalink
Merge pull request #3 from aiven/will-support-dict-config
Browse files Browse the repository at this point in the history
config: support configuration via Python dict
  • Loading branch information
juhovh-aiven authored May 7, 2020
2 parents 504d61d + 71687a7 commit e530ab7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions rpm_s3_mirror/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,12 @@ def __init__(self, path):
def _populate_required(self):
with open(self.path) as f:
self._config.update(json.load(f))


class DictConfig(Config):
def __init__(self, config_dict):
self._config.update(config_dict)
super().__init__()

def _populate_required(self):
pass
2 changes: 1 addition & 1 deletion rpm_s3_mirror/mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, config):
)
self.repositories = [RPMRepository(base_url=url) for url in config.upstream_repositories]

def sync(self, bootstrap):
def sync(self, bootstrap=False):
start = time.monotonic()
for upstream_repository in self.repositories:
mirror_start = time.monotonic()
Expand Down

0 comments on commit e530ab7

Please sign in to comment.