Class: VagrantPlugins::GuestClearLinux::TimezoneConfig
- Inherits:
-
Object
- Object
- VagrantPlugins::GuestClearLinux::TimezoneConfig
- Defined in:
- lib/vagrant-guests-clearlinux/provisioner.rb
Instance Attribute Summary collapse
-
#timezone ⇒ Object
Returns the value of attribute timezone.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ TimezoneConfig
constructor
A new instance of TimezoneConfig.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ TimezoneConfig
Returns a new instance of TimezoneConfig.
33 34 35 36 |
# File 'lib/vagrant-guests-clearlinux/provisioner.rb', line 33 def initialize super @timezone = UNSET_VALUE end |
Instance Attribute Details
#timezone ⇒ Object
Returns the value of attribute timezone.
31 32 33 |
# File 'lib/vagrant-guests-clearlinux/provisioner.rb', line 31 def timezone @timezone end |
Instance Method Details
#finalize! ⇒ Object
38 39 40 41 |
# File 'lib/vagrant-guests-clearlinux/provisioner.rb', line 38 def finalize! super @timezone = '' if @timezone == UNSET_VALUE end |
#validate(machine) ⇒ Object
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/vagrant-guests-clearlinux/provisioner.rb', line 43 def validate(machine) errors = _detected_errors TZInfo::Timezone.get(timezone) { "vm.provision.set_timezone:" => errors } rescue TZInfo::InvalidTimezoneIdentifier errors << "Invalid (user provided) timezone: '#{timezone}', Aborting!" { "vm.provision.set_timezone:" => errors } end |