github / github/octocatalog-diff
A notice function with a hash as a title causes catalog validation to fail
- Vorherrschende Sprache
- Ruby
- Sterne
- 252
- Forks
- 95
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
> Description of problem
- What did you do?
Running octocatalog-diff
```
octocatalog-diff --puppetdb_url http://localhost:8080 --bootstrapped-from-dir /var/tmp/production/ --bootstrapped-to-dir /var/tmp/development/ --puppet_binary /usr/local/bin/puppet --pe-enc-url https://localhost:4433/classifier-api --pe-enc-token-file /root/.puppetlabs/token -n appserver.example.com --catalog-only
```
- What happened?
Catalog failed to compile with invalid json
- What did you expect to happen?
Catalog to compile
- How can someone reproduce the problem?
Create an array of hashes and call one of those hashes.
ie
```puppet
class iaas_linux_ibm_tivoli_monitoring_client (
Array[Hash] $gateway_list = [ { primary => '',servername.domainname
standby => 'servername2.domainname' } ],
) {
$gateways = $::iaas_linux_ibm_tivoli_monitoring_client::gateway_list
$rand = fqdn_rand(length($gateways))
$randomly_chosen_gateways = "$gateways[$rand]"
}
```
> Command used and debugging output
```
octocatalog-diff --puppetdb_url http://localhost:8080 --bootstrapped-from-dir /var/tmp/production/ --bootstrapped-to-dir /var/tmp/development/ --puppet_binary /usr/local/bin/puppet --pe-enc-url https://localhost:4433/classifier-api --pe-enc-token-file /root/.puppetlabs/token -n appserver.example.com --catalog-only
"/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/octocatalog-diff-1.5.4/lib/octocatalog-diff/util/catalogs.rb:259:in `catalog_validator': Catalog failed: Catalog has invalid JSON: 751: unexpected token at '{primary => servername.domainname, standby => servername2.domainname} (OctocatalogDiff::Errors::CatalogError)
"
```
> Platform and version information
- Your OS: RHEL 7.4 x86
- Your Ruby version: ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-linux]
- Your version of Puppet: PE 2018.1.4 5.5.6
- Your version of octocatalog-diff: octocatalog-diff 1.5.4
> Do the tests pass from a clean checkout? yes
> Anything else to add that you think will be helpful?
Beitragsleitfaden
Rechercherichtung
Beginne mit lib/octocatalog-diff/util/catalogs.rb bei catalog_validator und reproduziere anschließend den Fehler mit dem octocatalog-diff-Befehl und dem Puppet-Beispiel aus dem Issue. Verfolge, wie das Array von Hashes während der Katalogvalidierung dargestellt wird; fertig ist die Arbeit, wenn der Katalog kompiliert und der Fehler wegen ungültigem JSON in diesem Fall nicht mehr auftritt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- ruby
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100