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.
32 33 34 35 |
# File 'lib/vagrant-guests-clearlinux/provisioner.rb', line 32 def initialize super @timezone = UNSET_VALUE end |
Instance Attribute Details
#timezone ⇒ Object
Returns the value of attribute timezone.
30 31 32 |
# File 'lib/vagrant-guests-clearlinux/provisioner.rb', line 30 def timezone @timezone end |
Instance Method Details
#finalize! ⇒ Object
37 38 39 40 |
# File 'lib/vagrant-guests-clearlinux/provisioner.rb', line 37 def finalize! super @timezone = '' if @timezone == UNSET_VALUE end |
#validate(_machine) ⇒ Object
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/vagrant-guests-clearlinux/provisioner.rb', line 42 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 |