Skip to content
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

ncm-ceph: fix incorrect paths for 'ls' and 'cat' commands on el6 #324

Merged
merged 3 commits into from Oct 30, 2014

Conversation

kwaegema
Copy link
Member

@kwaegema kwaegema commented Oct 8, 2014

No description provided.

@hpcugentbot
Copy link

Test FAILed.

@kwaegema kwaegema changed the title fix for cat and ls things ncm-ceph: fix for cat and ls things Oct 8, 2014
@@ -34,6 +34,8 @@ use Sys::Hostname;
our $EC=LC::Exception::Context->new->will_store_all;
Readonly my $OSDBASE => qw(/var/lib/ceph/osd/);
Readonly my $JOURNALBASE => qw(/var/lib/ceph/log/);
Readonly::Array our @LS_COMMAND => ('/bin/ls');
Readonly::Array our @CAT_COMMAND => ('/bin/cat');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only one definition pls

@hpcugentbot
Copy link

Test FAILed.

@jrha jrha added this to the 14.10 milestone Oct 8, 2014
@@ -44,7 +44,7 @@ Readonly my $CRUSH_TT_FILE => 'ceph/crush.tt';
# Get the osd name from the host and path
sub get_osd_name {
my ($self, $host, $location) = @_;
my $id = $self->run_command_as_ceph_with_ssh(['/usr/bin/cat', "$location/whoami"], $host) or return 0;
my $id = $self->run_cat_command_as_ceph_with_ssh(["$location/whoami"], $host) or return 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I prefer the previous version.

Just

my $id = $self->run_command_as_ceph_with_ssh([@CAT_COMMAND, "$location/whoami"], $host) or return 0;

The other method doesn't give any benefit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the issue is that we have 2 "modules" that then define the same readonly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

I see command management is done in NCM::Component::Ceph::commands. It should export whatever constants it needs, maybe with a tag, just as it does for @SSH_COMMAND.

Say:

package NCM::Component::Ceph::commands;

use base qw(Exporter);
use Readonly;

Readonly::Array our @CAT_COMMAND => ...;

our %EXPORT_TAGS = (commands => [qw(@CAT_COMMAND @SSH_COMMAND...)];

And in the consumers:

use NCM::Component::Ceph::Commands qw(:commands);

# Use @SSH_COMMAND and @CAT_COMMAND at will.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we were considering this before for the SSH_COMMAND some time ago. But the issue still stays, that , in our main ceph.pm, we do:
use base qw(NCM::Component NCM::Component::Ceph::commands NCM::Component::Ceph::crushmap NCM::Component::Ceph::daemon NCM::Component::Ceph::config NCM::Component::Ceph::compare );
This way, we duplicate the includes 😄

@stdweird
Copy link
Member

retest this please

@hpcugentbot
Copy link

Test PASSed.

@jrha
Copy link
Member

jrha commented Oct 22, 2014

Could you improve the title of this PR please, it will end up in the release notes and this one isn't clear and looks a bit silly.

@kwaegema kwaegema changed the title ncm-ceph: fix for cat and ls things ncm-ceph: fix incorrect paths for 'ls' and 'cat' commands on el6 Oct 22, 2014
'/usr/bin/ssh', '-o', 'ControlMaster=auto',
'-o', 'ControlPersist=600', '-o', 'ControlPath=/tmp/ssh_mux_%h_%p_%r'
);

Readonly::Array my @CAT_COMMAND => ('/bin/cat');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge as is. Address the qw requirement in the other pull request.

@hpcugentbot
Copy link

Test PASSed.

@piojo-zz
Copy link
Member

@kwaegema after merging other PRs this one won't merge cleanly anymore.

Please, rebase or resolve the conflicts and it's good to merge.

@hpcugentbot
Copy link

Test PASSed.

@jrha
Copy link
Member

jrha commented Oct 30, 2014

LGTM

@kwaegema
Copy link
Member Author

@Piojo rebase done

jrha added a commit that referenced this pull request Oct 30, 2014
ncm-ceph: fix incorrect paths for 'ls' and 'cat' commands on el6
@jrha jrha merged commit 71df994 into quattor:master Oct 30, 2014
@kwaegema kwaegema deleted the catlsfix branch December 5, 2014 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants