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

Fix logging issue from bug #1477 #1478

Merged
merged 1 commit into from
Dec 11, 2019
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
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 @@ -32,19 +32,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