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

Nexpose client gem: Module ISO8601: method to_string bug #305

Open
jbrunner-r7 opened this issue Oct 19, 2017 · 0 comments
Open

Nexpose client gem: Module ISO8601: method to_string bug #305

jbrunner-r7 opened this issue Oct 19, 2017 · 0 comments
Labels

Comments

@jbrunner-r7
Copy link

Expected Behavior

Current Behavior

When trying to save a site with a Schedule object, I currently get the following error:

C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/util.rb:105:in to_string': undefined method to_time' for "20181016T181411.812Z":String (NoMethodError)
Did you mean? to_i
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/common.rb:221:in to_h' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/site.rb:428:in map'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/site.rb:428:in to_h' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/site.rb:411:in to_json'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nexpose-7.1.1/lib/nexpose/site.rb:517:in save' from set-sites-schedule.rb:42:in

'

Possible Solution

By replacing the current line with the one I've specified below, I was able to save the schedule in the site.
In util.rb on line 105 (https://github.com/rapid7/nexpose-client/blob/master/lib/nexpose/util.rb#L105), shouldn't the line be:

to_time(time).utc.strftime('%Y%m%dT%H%M%S.%LZ')

Steps to Reproduce (for bugs)

Ruby code that reproduces the issue:

puts "this is only an example Ruby code block"

Context

Your Environment

  • Nexpose gem version:
  • Ruby version:
  • Operating System and version:
  • Nexpose product version:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants