Skip to content

Commit

Permalink
Merge pull request #3263 from canonical/fix-empty-snapshot-args
Browse files Browse the repository at this point in the history
[snapshots] Fix interpreting empty snapshot name in snapshot args

r=sharder996 a=ricab
  • Loading branch information
sharder996 authored Oct 20, 2023
2 parents ab0f815 + 3a5b364 commit 377aca2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/daemon/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1167,13 +1167,12 @@ InstanceSnapshotsMap map_snapshots_to_instances(const InstanceSnapshotPairs& ins
for (const auto& it : instances_snapshots)
{
const auto& instance = it.instance_name();
const auto& snapshot = it.snapshot_name();
auto& snapshot_pick = instance_snapshots_map[instance];

if (snapshot.empty())
if (!it.has_snapshot_name())
snapshot_pick.all_or_none = true;
else
snapshot_pick.pick.insert(snapshot);
snapshot_pick.pick.insert(it.snapshot_name());

Check warning on line 1175 in src/daemon/daemon.cpp

View check run for this annotation

Codecov / codecov/patch

src/daemon/daemon.cpp#L1175

Added line #L1175 was not covered by tests
}

return instance_snapshots_map;
Expand Down

0 comments on commit 377aca2

Please sign in to comment.