Skip to content

Commit

Permalink
puppet-lint: fix top_scope_facts
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Dec 16, 2021
1 parent 261177a commit 5fca8f8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions examples/facts.pp
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
if $::cassandrarelease {
notify { "Cassandra release: ${::cassandrarelease}": }
if $facts['cassandrarelease'] {
notify { "Cassandra release: ${facts['cassandrarelease']}": }
} else {
warning('::cassandrarelease is not set!')
warning('fact cassandrarelease is not set!')
}

if $::cassandramajorversion {
notify { "Cassandra major version: ${::cassandramajorversion}": }
if $facts['cassandramajorversion'] {
notify { "Cassandra major version: ${facts['cassandramajorversion']}": }
} else {
warning('::cassandramajorversion is not set!')
warning('fact cassandramajorversion is not set!')
}

if $::cassandraminorversion {
notify { "Cassandra minor version: ${::cassandraminorversion}": }
if $facts['cassandraminorversion'] {
notify { "Cassandra minor version: ${facts['cassandraminorversion']}": }
} else {
warning('::cassandraminorversion is not set!')
warning('fact cassandraminorversion is not set!')
}

if $::cassandrapatchversion {
notify { "Cassandra patch version: ${::cassandrapatchversion}": }
if $facts['cassandrapatchversion'] {
notify { "Cassandra patch version: ${facts['cassandrapatchversion']}": }
} else {
warning('::cassandrapatchversion is not set!')
warning('fact cassandrapatchversion is not set!')
}
4 changes: 2 additions & 2 deletions manifests/schema/user.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
$quote = '"'
}

if $::cassandrarelease != undef {
if versioncmp($::cassandrarelease, '2.2') < 0 {
if $facts['cassandrarelease'] {
if versioncmp($facts['cassandrarelease'], '2.2') < 0 {
$operate_with_roles = false
} else {
$operate_with_roles = true
Expand Down

0 comments on commit 5fca8f8

Please sign in to comment.