Sha256: f27cd4cf9e38a92cbf3a381f2383d98758f8702f937823ac01ca7cfd66b1ed92

Contents?: true

Size: 814 Bytes

Versions: 7

Compression:

Stored size: 814 Bytes

Contents

module Pvcglue
  class Packages
    class MaintenanceMode < Pvcglue::Packages
      def installed?
        false
      end

      def install!
        if options[:maintenance_mode] == 'on'
          connection.run!(user_name, '', "touch #{Pvcglue.cloud.maintenance_mode_file_name}")
        elsif options[:maintenance_mode] == 'off'
          result = connection.run?(user_name, '', "rm #{Pvcglue.cloud.maintenance_mode_file_name}")
          if result.exitstatus == 1
            Pvcglue.logger.warn('Maintenance mode was already off.')
          elsif result.exitstatus != 0
            raise result.inspect
          end
        else
          raise("Invalid maintenance_mode option:  #{options[:maintenance_mode]}")
        end
      end

      def post_install_check?
        true
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pvcglue-0.9.6 lib/pvcglue/packages/maintenance_mode.rb
pvcglue-0.9.5 lib/pvcglue/packages/maintenance_mode.rb
pvcglue-0.9.4 lib/pvcglue/packages/maintenance_mode.rb
pvcglue-0.9.3 lib/pvcglue/packages/maintenance_mode.rb
pvcglue-0.9.2 lib/pvcglue/packages/maintenance_mode.rb
pvcglue-0.9.1 lib/pvcglue/packages/maintenance_mode.rb
pvcglue-0.9.0 lib/pvcglue/packages/maintenance_mode.rb