Sha256: 68a1d47cefd977691f8f90bdeb66582586f58420ae2b5597e139f74ce88c1837

Contents?: true

Size: 1.17 KB

Versions: 25

Compression:

Stored size: 1.17 KB

Contents

module SpecInfra
  module Command
    class Fedora < RedHat
      def check_enabled(service, target="multi-user.target")
        host_port = SpecInfra.configuration.ssh ? [SpecInfra.configuration.ssh.host, SpecInfra.configuration.ssh.options[:port]] : ['localhost', nil]
        if property.has_key?(:os_by_host) && property[:os_by_host][host_port][: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_port = SpecInfra.configuration.ssh ? [SpecInfra.configuration.ssh.host, SpecInfra.configuration.ssh.options[:port]] : ['localhost', nil]
        if property.has_key?(:os_by_host) && property[:os_by_host][host_port][:release].to_i < 15
          super
        else
          "systemctl is-active #{escape(service)}.service"
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
specinfra-1.27.5 lib/specinfra/command/fedora.rb
specinfra-1.27.4 lib/specinfra/command/fedora.rb
specinfra-1.27.3 lib/specinfra/command/fedora.rb
specinfra-1.27.2 lib/specinfra/command/fedora.rb
specinfra-1.27.1 lib/specinfra/command/fedora.rb
specinfra-1.27.0 lib/specinfra/command/fedora.rb
specinfra-1.26.0 lib/specinfra/command/fedora.rb
specinfra-1.25.8 lib/specinfra/command/fedora.rb
specinfra-1.25.7 lib/specinfra/command/fedora.rb
specinfra-1.25.6 lib/specinfra/command/fedora.rb
specinfra-1.25.5 lib/specinfra/command/fedora.rb
specinfra-1.25.4 lib/specinfra/command/fedora.rb
specinfra-1.25.3 lib/specinfra/command/fedora.rb
specinfra-1.25.2 lib/specinfra/command/fedora.rb
specinfra-1.25.1 lib/specinfra/command/fedora.rb
specinfra-1.25.0 lib/specinfra/command/fedora.rb
specinfra-1.24.0 lib/specinfra/command/fedora.rb
specinfra-1.23.1 lib/specinfra/command/fedora.rb
specinfra-1.23.0 lib/specinfra/command/fedora.rb
specinfra-1.22.1 lib/specinfra/command/fedora.rb