Skip to content

Commit

Permalink
lxc/list: Don't skip extra info when name filtering
Browse files Browse the repository at this point in the history
Closes canonical#10370

Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed May 6, 2022
1 parent 2a60611 commit a6801cf
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions lxc/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,24 +492,7 @@ func (c *cmdList) Run(cmd *cobra.Command, args []string) error {
return err
}

// Check if we have any name based filters.
nameFilter := false
for _, filter := range filters {
// If not key=value syntax, it's a name filter.
if !strings.Contains(filter, "=") {
nameFilter = true
break
}

// If not straightforward key=value, assume name filter.
fields := strings.SplitN(filter, "=", 2)
if len(fields) != 2 {
nameFilter = true
break
}
}

if !nameFilter && needsData && d.HasExtension("container_full") {
if needsData && d.HasExtension("container_full") {
// Using the GetInstancesFull shortcut
var cts []api.InstanceFull
if c.flagAllProjects {
Expand Down

0 comments on commit a6801cf

Please sign in to comment.