Sha256: d56c3710ad6a4746845d1fd425e74f5f1e80de6b9731ed5895297e4cc1acc9d6

Contents?: true

Size: 1.05 KB

Versions: 14

Compression:

Stored size: 1.05 KB

Contents

module SpecInfra
  module Command
    class Fedora < RedHat
      def check_enabled(service, target="multi-user.target")
        host = SpecInfra.configuration.ssh ? SpecInfra.configuration.ssh.host : 'localhost'
        if property.has_key?(:os_by_host) && property[:os_by_host][host][:release].to_i < 15
          super
        else
          # Fedora 15+ uses systemd which no longer has runlevels but targets
          # For backwards compatibility, Fedora provides pseudo targets for
          # runlevels
          if target.is_a? Integer
            target = "runlevel#{target}.target"
          end
          "systemctl --plain list-dependencies #{target} | grep '^#{escape(service)}.service$'"
        end
      end

      def check_running(service)
        host = SpecInfra.configuration.ssh ? SpecInfra.configuration.ssh.host : 'localhost'
        if property.has_key?(:os_by_host) && property[:os_by_host][host][:release].to_i < 15
          super
        else
          "systemctl is-active #{escape(service)}.service"
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
specinfra-1.18.3 lib/specinfra/command/fedora.rb
specinfra-1.18.2 lib/specinfra/command/fedora.rb
specinfra-1.18.1 lib/specinfra/command/fedora.rb
specinfra-1.18.0 lib/specinfra/command/fedora.rb
specinfra-1.17.0 lib/specinfra/command/fedora.rb
specinfra-1.16.0 lib/specinfra/command/fedora.rb
specinfra-1.15.1 lib/specinfra/command/fedora.rb
specinfra-1.15.0 lib/specinfra/command/fedora.rb
specinfra-1.14.0 lib/specinfra/command/fedora.rb
specinfra-1.13.1 lib/specinfra/command/fedora.rb
specinfra-1.13.0 lib/specinfra/command/fedora.rb
specinfra-1.12.0 lib/specinfra/command/fedora.rb
specinfra-1.11.0 lib/specinfra/command/fedora.rb
specinfra-1.10.0 lib/specinfra/command/fedora.rb