Skip to content

Commit

Permalink
Merge pull request #400 from guillomovitch/2.4.x
Browse files Browse the repository at this point in the history
trim trailing whitespaces in lxc-ls output (issue #378)
  • Loading branch information
guillomovitch committed Nov 11, 2017
2 parents e831e61 + e662ab9 commit a533aec
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ sub _getVirtualMachines {
my @machines;

while(my $name = <$handle>) {
# lxc-ls -1 shows one entry by line, just skip line if empty as name can contain space
# lxc-ls -1 shows one entry by line
chomp $name;
next unless length($name);
$name =~ s/\s+$//; # trim trailing whitespace
next unless length($name); # skip if empty as name can contain space

my $status = _getVirtualMachineState(
command => "/usr/bin/lxc-info -n '$name'",
Expand Down

0 comments on commit a533aec

Please sign in to comment.