Skip to content

Commit

Permalink
[runtime-info] Rename implementation classes
Browse files Browse the repository at this point in the history
Shorten the name of implementation-detail classes whose scope is now
contained.
  • Loading branch information
ricab committed Apr 26, 2024
1 parent 88654f2 commit ebb3b0a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/daemon/runtime_instance_info_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace mp = multipass;
namespace
{

struct RuntimeInfoKeys
struct Keys
{
public:
static constexpr auto loadavg_key = "loadavg";
Expand All @@ -43,10 +43,9 @@ struct RuntimeInfoKeys
static constexpr auto current_release_key = "current_release";
};

struct RuntimeInfoCmds
struct Cmds
{
private:
using Keys = RuntimeInfoKeys;
static constexpr auto key_val_cmd = R"(echo {}: \"$(eval "{}")\")";
static constexpr std::array key_cmds_pairs{
std::pair{Keys::loadavg_key, "cat /proc/loadavg | cut -d ' ' -f1-3"},
Expand Down Expand Up @@ -81,9 +80,6 @@ void mp::RuntimeInstanceInfoHelper::populate_runtime_info(mp::VirtualMachine& vm
const std::string& original_release,
bool parallelize)
{
using Keys = RuntimeInfoKeys; // TODO@ricab just rename the types now
using Cmds = RuntimeInfoCmds;

const auto& cmd = parallelize ? Cmds::parallel_composite_cmd : Cmds::sequential_composite_cmd;
auto results = YAML::Load(vm.ssh_exec(cmd));

Check warning on line 84 in src/daemon/runtime_instance_info_helper.cpp

View check run for this annotation

Codecov / codecov/patch

src/daemon/runtime_instance_info_helper.cpp#L83-L84

Added lines #L83 - L84 were not covered by tests

Expand Down

0 comments on commit ebb3b0a

Please sign in to comment.