New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker containers inventory #225

Merged
merged 5 commits into from Feb 15, 2017

Conversation

Projects
None yet
2 participants
@devtom30
Copy link
Contributor

devtom30 commented Feb 7, 2017

No description provided.

devtom30 added some commits Feb 7, 2017

.travis.yml Outdated
@@ -20,3 +20,4 @@ branches:
only:
- master
- 2.3.x
- 2.3.x-dockerContainersInventory

This comment has been minimized.

@g-bougard

g-bougard Feb 9, 2017

Member

Please don't merge your yaml


return unless $handle;

my $entete = <$handle>;

This comment has been minimized.

@g-bougard

g-bougard Feb 9, 2017

Member

Please better use english language to name your scalars: entete => header

our $STATUS_CRASHED = 'crashed';
our $STATUS_DYING = 'dying';
our $STATUS_OFF = 'off';

This comment has been minimized.

@g-bougard

g-bougard Feb 9, 2017

Member

Personally, I would prefer a hash here in place of x scalar or even some "use constant" declaration & export of them. You should also check if this could be re-used in other sub-classes.

my ($list, $index) = @_;

# what is last index ?
my $i = scalar @$list - 1;

This comment has been minimized.

@g-bougard

g-bougard Feb 9, 2017

Member

better use: my $i = $#{$list};

my @containers;
while (my $line = <$handle>) {
chomp $line;
my @info = split(/ +/, $line);

This comment has been minimized.

@g-bougard

g-bougard Feb 9, 2017

Member

What happen if someone start a docker command with a command-line including 2 follwoing white spaces ?

This comment has been minimized.

@devtom30

devtom30 Feb 10, 2017

Contributor

Hum. Yes, it's right. I have to change this split now. The good thing is that the command is always placed between two '"' (double quotes).

use Test::More;
use Test::NoWarnings;
use JSON::PP;
use Data::Dumper;

This comment has been minimized.

@g-bougard

g-bougard Feb 15, 2017

Member

Last point, remove this no more used debug library use ;)

@g-bougard g-bougard merged commit 3b63efe into fusioninventory:2.3.x Feb 15, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@devtom30 devtom30 deleted the devtom30:2.3.x-dockerContainersInventory_PR2 branch Jun 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment