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

Configuring ~/.cassandra/cqlshrc to display query results with colors breaks cassandra::schema #454

Open
jchoksijudopay opened this issue Dec 17, 2019 · 1 comment

Comments

@jchoksijudopay
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.11.1
  • Ruby: 2.5.3p105 (2018-10-18 revision 65156)
  • Distribution: CentOS 7
  • Module version: 2.7.3

How to reproduce (e.g Puppet code you use)

class { 'cassandra::schema':
  cqlsh_user     => 'puppet',
  cqlsh_password => $puppet_user_password,
  users          => {
    'dummy1'    => {
      password  => $dummy1_user_password,
      superuser => true,
    },
    'dummy2'  => {
      password  => $dummy2_user_password,
      superuser => true,
    },
    'cassandra' => {
      ensure => absent,
    }
  },
  require        => Exec['cassandra-bootstrap'],
}

What are you seeing

The puppet module keeps trying to create the dummy1 and dummy2 users and fails to remove the cassandra user on each run.

What behaviour did you expect instead

The dummy1 and dummy2 users should have been created once and the cassandra user should have been removed.

Any additional information you'd like to impart

We identified that the issue was being caused by the enabling of color output in query results. This broke the logic in https://github.com/voxpupuli/puppet-cassandra/blob/master/manifests/schema/user.pp as it was not expecting the extra characters when running cqlsh and checking its output.

File: ~/.cassandra/cqlshrc

[ui]
;; Whether or not to display query results with colors
color = on

A quick fix for us was to make use of the cqlsh_additional_options parameter and set it to: --no-color.

Raised this issue to request whether the cqlsh_additional_options could be set to --no-color as a default to prevent others facing an issue.

@igalic
Copy link

igalic commented Dec 18, 2019

yes, we could do that.

alternatively, we might want to ignore ~/.cassandra/cqlshrc

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

No branches or pull requests

2 participants