bdangit / chef-influxdb

A cookbook for InfluxDB, a time-series database (influxdb.org)
MIT License
54 stars 83 forks source link

[Continuous query] Fix attribute naming #176

Open pygillier opened 5 years ago

pygillier commented 5 years ago

Under at least Chef 14, cookbook run fails when updating a CQ resource :

NameError
    ---------
    undefined local variable or method `name' for #<#<Class:0x0000000003f915e8>:0x0000000003f53450>

    Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/influxdb/resources/continuous_query.rb:27:in `block in class_from_file'

By explicitely using new_resource variable, error is fixed.

bdangit commented 5 years ago

Hi @pygillier thanks for the PR. There is a styling error that rubocop detected:

export WERCKER_STEP_ROOT="/pipeline/script-3d3f9213-1cda-423f-9e23-1278e4b2e1e0"
export WERCKER_STEP_ID="script-3d3f9213-1cda-423f-9e23-1278e4b2e1e0"
export WERCKER_STEP_OWNER="wercker"
export WERCKER_STEP_NAME="script"
export WERCKER_REPORT_NUMBERS_FILE="/report/script-3d3f9213-1cda-423f-9e23-1278e4b2e1e0/numbers.ini"
export WERCKER_REPORT_MESSAGE_FILE="/report/script-3d3f9213-1cda-423f-9e23-1278e4b2e1e0/message.txt"
export WERCKER_REPORT_ARTIFACTS_DIR="/report/script-3d3f9213-1cda-423f-9e23-1278e4b2e1e0/artifacts"
source "/pipeline/script-3d3f9213-1cda-423f-9e23-1278e4b2e1e0/run.sh" < /dev/null
Running RuboCop...
Inspecting 27 files
...........................

27 files inspected, no offenses detected
Starting Foodcritic linting...
Checking 16 files
..........x.....
FC085: Resource using new_resource.updated_by_last_action to converge resource: /pipeline/source/resources/continuous_query.rb:25
bdangit commented 5 years ago

hi @pygillier can run chef exec "rake test:quick"? it should show any lints and styling that is required.