Skip to content

Loading…

Activate console local time #23

Merged
merged 2 commits into from

2 participants

@scsmith

Make activate_console show the expiry in the user's local time.

@gnufied gnufied merged commit a52f96f into master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 3 additions and 2 deletions.
  1. +2 −1 lib/brightbox-cli/commands/servers-activate-console.rb
  2. +1 −1 lib/brightbox-cli/ruby_core_ext.rb
View
3 lib/brightbox-cli/commands/servers-activate-console.rb
@@ -17,7 +17,8 @@ module Brightbox
info "Activating console for server #{s}"
r = s.activate_console
url = "#{r["console_url"]}/?password=#{r["console_token"]}"
- consoles << { :url => url, :token => r["console_token"], :expires => r["console_token_expires"] }
+ expires = Time.parse(r["console_token_expires"])
+ consoles << { :url => url, :token => r["console_token"], :expires => expires.localtime.to_s }
end
render_table(consoles, global_options.merge(:fields => [:url, :token, :expires], :resize => false))
View
2 lib/brightbox-cli/ruby_core_ext.rb
@@ -1,6 +1,6 @@
class Time
def rfc8601
- self.strftime("%Y-%m-%dT%H:%M")
+ self.strftime(self.utc? ? "%Y-%m-%dT%H:%MZ" : "%Y-%m-%dT%H:%M")
end
def to_s
Something went wrong with that request. Please try again.