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

Corrections for rabbitmq-server 3.4.0-1 #247

Closed
wants to merge 8 commits into from
Closed

Corrections for rabbitmq-server 3.4.0-1 #247

wants to merge 8 commits into from

Conversation

mvisonneau
Copy link
Contributor

I had to make those adjustments to get it working after the upgrade of the RabbitMQ package to version 3.4.0-1 on an Ubuntu 14.04.1 LTS

@mvisonneau
Copy link
Contributor Author

It seems that there are some retrocompatibily issues though.. :(

@stefanandres
Copy link

The evil thing is that this affects all new Ubuntu-12 and Ubuntu-14 deployed server when you do not pin the rabbitmq-server package. :-(

@zstyblik
Copy link

It seems that there are some retrocompatibily issues though.. :(

Where? Which ones?

Thanks.

@zstyblik
Copy link

ii rabbitmq-server 3.3.5-1

% rabbitmqctl list_vhosts
Listing vhosts ...
/
/foo
/bar
/lar
...done.

ii rabbitmq-server 3.4.0-1

% rabbitmqctl list_vhosts
Listing vhosts ...
/
/foo
/bar
/lar

@zstyblik
Copy link

Two more questions:

  1. Why is output even truncated since output is being matched against regexp and it must be an exact match from the beginning to the end of the line?
  2. If those lines should be skipped and compatibility kept, why not to do something like:
for line in output.split():
    if line == 'Listing vhosts ...' or line == '...done.':
        continue
    else:
        # match the line

This way, unwanted lines are skipped.

@mvisonneau
Copy link
Contributor Author

I just commited a version I tested sucessfully on 3.3.5-1 and 3.4.0-1. Kinda dirty though.. :)

@gcmalloc
Copy link

thanks a lot for that :)
I just felt into this.

@zstyblik
Copy link

  def exists?
    out = rabbitmqctl('list_vhosts').split(/\n/)[0..-1].detect do |line|
      if line == 'Listing vhosts ...' or line == '... done.'
        continue
      end
      line.match(/^#{Regexp.escape(resource[:name])}$/)
    end
  end

But as I've said previously, it does little sense given the regexp. Also, brear in mind, once these texts change, it will be back to square one again.

@Vincent--
Copy link

Could I suggest to use "-q" option to make rabbitmqctl less verbose and not depend on future cosmetical evolution...

[-q]
Quiet output mode is selected with the "-q" flag. Informational messages are suppressed when quiet mode is in effect.

Before :

sudo /usr/sbin/rabbitmqctl list_users
Listing users ...
rguser  [administrator]

After :

sudo /usr/sbin/rabbitmqctl -q list_users
rguser  [administrator]

With that option,

rabbitmqctl('list_users').split(/\n/)[1..-2].detect do |line|

should be

rabbitmqctl('list_users').split(/\n/)[0..-1].detect do |line|

Cheers,
Vincent

@mvisonneau
Copy link
Contributor Author

Thanks, great idea @Vincent-- I managed to get it working in both version using this option.

@Vincent--
Copy link

Thank you for doing that ! I think this is the robust way to do that...
I hope the merge will be done soon...

miqui added a commit to miqui/puppetlabs-rabbitmq that referenced this pull request Oct 24, 2014
@cmurphy
Copy link
Contributor

cmurphy commented Dec 2, 2014

The same solution was implemented in #251, which we already merged. Thanks!

@cmurphy cmurphy closed this Dec 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants