Skip to content

NoMethodError: undefined method `dev' for nil:NilClass #4

@karlkfi

Description

@karlkfi

The current BOSH code (specifically the BATs) does not seem to work with the bosh_vcloud_cpi. The problem seems to have been caused by the recent move to using Logging::Logger instead of ruby's Logger. The new logger has a similar API to the ruby logger, but is not an extention. So it's not entirely reverse compatible.

It seems that ruby_vcloud_sdk is expecting a Logger type object and then using reflection to access the @logdev instance variable in order to find the file path of the log device, but there is no @logdev variable in Logging::Logger.

https://github.com/vchs/ruby_vcloud_sdk/blob/master/lib/ruby_vcloud_sdk/connection/connection.rb#L164

I'm not entirely sure what a desirable solution is in this case, but it's probably a bad idea to use reflection on an injected object, especially without verifying it's type.

Logging::Logger uses appenders to designate where the logs go. Multiple appenders are supported per logger. So even if you need to continue reaching into the logger, it might be more difficult to determine what file to log to unless both bosh_vcloud_cpi and ruby_vcloud_sdk also switch to using Logging::Logger.

It looks like the 'rest_logger' is actually a new file. Is it important that it be next to the other CPI logs? If not it might be desirable to inject a different file path or use a temp file.

bosh_vcloud_cpi cannot be bumped in bosh until this is resolved. How would you like to proceed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions