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

octofacts does not like unquoted yaml keys that look like floats #4

Open
sirinek opened this issue Jul 10, 2018 · 0 comments
Open

octofacts does not like unquoted yaml keys that look like floats #4

sirinek opened this issue Jul 10, 2018 · 0 comments

Comments

@sirinek
Copy link

sirinek commented Jul 10, 2018

Description of problem

  • What did you do? Tried to run a test
  • What happened? An error showed up about not being able to convert a float to a symbol.
  • What did you expect to happen? Nothing (I am not using this particular fact)
  • How can someone reproduce the problem? Add the fact to a fact file and run a test using that file.

Command/code used

rake spec

Platform and version information

  • Your OS: RHEL 7
  • Your Ruby version: ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
  • Your version of Puppet: 5.3.5 (PE 2017.3.5)
  • Your version of octofacts: 0.5.1

Do the tests pass from a clean checkout? Yes all tests pass

Anything else to add that you think will be helpful?

I have a flat file of facts from my puppet master, but Octofacts does not like it. In particular it trips up on the following YAML:

pe_postgresql_info:
  installed_server_version: "9.6"
  data_partition_size_bytes: 804913152000
  data_partition_available_bytes: 598647898112
  versions:
    9.4:
      app_dir: /opt/puppetlabs/server/apps/postgresql/9.4
      data_dir: /opt/puppetlabs/server/data/postgresql/9.4
      tablespaces:
        - /opt/puppetlabs/server/data/postgresql/activity/PG_9.4_201409291
        - /opt/puppetlabs/server/data/postgresql/classifier/PG_9.4_201409291
        - /opt/puppetlabs/server/data/postgresql/orchestrator/PG_9.4_201409291
        - /opt/puppetlabs/server/data/postgresql/puppetdb/PG_9.4_201409291
        - /opt/puppetlabs/server/data/postgresql/rbac/PG_9.4_201409291
      used_bytes: 91782041600
    9.6:
      app_dir: /opt/puppetlabs/server/apps/postgresql
      data_dir: /opt/puppetlabs/server/data/postgresql/9.6
      tablespaces:
        - /opt/puppetlabs/server/data/postgresql/activity/PG_9.6_201608131
        - /opt/puppetlabs/server/data/postgresql/classifier/PG_9.6_201608131
        - /opt/puppetlabs/server/data/postgresql/orchestrator/PG_9.6_201608131
        - /opt/puppetlabs/server/data/postgresql/puppetdb/PG_9.6_201608131
        - /opt/puppetlabs/server/data/postgresql/rbac/PG_9.6_201608131
      used_bytes: 100328099840

When I use the fact file in a test, I get the following error:

     NoMethodError:
       undefined method `to_sym' for 9.4:Float
       Did you mean?  to_s
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

1 participant