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

Commit

Permalink
Fix logging issue from bug #1477 (#1478)
Browse files Browse the repository at this point in the history
Fix logging issue from bug #1477
  • Loading branch information
lbonn authored Dec 11, 2019
2 parents 85543a5 + 247de0c commit a699eb9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/libaktualizr/package_manager/dockerappmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class DockerAppManager : public OstreeManager {
DockerAppManager(PackageConfig pconfig, BootloaderConfig bconfig, std::shared_ptr<INvStorage> storage,
std::shared_ptr<HttpInterface> http)
: OstreeManager(std::move(pconfig), std::move(bconfig), std::move(storage), std::move(http)) {
fake_fetcher_ = std::make_shared<Uptane::Fetcher>(Config(), http_);
fake_fetcher_ = std::make_shared<Uptane::Fetcher>("", "", http_);
}
bool fetchTarget(const Uptane::Target &target, Uptane::Fetcher &fetcher, const KeyManager &keys,
FetcherProgressCb progress_cb, const api::FlowControlToken *token) override;
Expand Down
2 changes: 1 addition & 1 deletion src/libaktualizr/uptane/fetcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Uptane {
bool Fetcher::fetchRole(std::string* result, int64_t maxsize, RepositoryType repo, const Uptane::Role& role,
Version version) const {
// TODO: chain-loading root.json
std::string url = (repo == RepositoryType::Director()) ? config.uptane.director_server : config.uptane.repo_server;
std::string url = (repo == RepositoryType::Director()) ? director_server : repo_server;
if (role.IsDelegation()) {
url += "/delegations";
}
Expand Down
11 changes: 8 additions & 3 deletions src/libaktualizr/uptane/fetcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,24 @@ class IMetadataFetcher {
class Fetcher : public IMetadataFetcher {
public:
Fetcher(const Config& config_in, std::shared_ptr<HttpInterface> http_in)
: http(std::move(http_in)), config(config_in) {}
: Fetcher(config_in.uptane.repo_server, config_in.uptane.director_server, std::move(http_in)) {}
Fetcher(std::string repo_server_in, std::string director_server_in, std::shared_ptr<HttpInterface> http_in)
: http(std::move(http_in)),
repo_server(std::move(repo_server_in)),
director_server(std::move(director_server_in)) {}
bool fetchRole(std::string* result, int64_t maxsize, RepositoryType repo, const Uptane::Role& role,
Version version) const override;
bool fetchLatestRole(std::string* result, int64_t maxsize, RepositoryType repo,
const Uptane::Role& role) const override {
return fetchRole(result, maxsize, repo, role, Version());
}

std::string getRepoServer() const { return config.uptane.repo_server; }
std::string getRepoServer() const { return repo_server; }

private:
std::shared_ptr<HttpInterface> http;
const Config& config;
std::string repo_server;
std::string director_server;
};

} // namespace Uptane
Expand Down

0 comments on commit a699eb9

Please sign in to comment.