Sha256: d7c8f1927f41b08a5e4327c2ec77b576fbefca7cf2bee3b3bb20aaf8cc7d10be

Contents?: true

Size: 1.23 KB

Versions: 13

Compression:

Stored size: 1.23 KB

Contents

require 'pathname'

module Vagrant
  module Hosts
    class Fedora < Linux
      def self.match?
        release_file = Pathname.new("/etc/redhat-release")

        if release_file.exist?
          release_file.open("r") do |f|
            return true if f.gets =~ /^Fedora/
          end
        end

        false
      end

      # Normal, mid-range precedence.
      def self.precedence
        5
      end

      def initialize(*args)
        super

        @nfs_server_binary = "/etc/init.d/nfs"

        # On Fedora 16+, systemd replaced init.d, so we have to use the
        # proper NFS binary. This checks to see if we need to do that.
        release_file = Pathname.new("/etc/redhat-release")
        begin
          release_file.open("r") do |f|
            version_number = /Fedora release ([0-9]+)/.match(f.gets)[1].to_i
            if version_number >= 16
              # "service nfs-server" will redirect properly to systemctl
              # when "service nfs-server restart" is called.
              @nfs_server_binary = "/usr/sbin/service nfs-server"
            end
          end
        rescue Errno::ENOENT
          # File doesn't exist, not a big deal, assume we're on a
          # lower version.
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 6 rubygems

Version Path
bmhatfield-vagrant-1.0.10 lib/vagrant/hosts/fedora.rb
bmhatfield-vagrant-1.0.9 lib/vagrant/hosts/fedora.rb
bmhatfield-vagrant-1.0.8 lib/vagrant/hosts/fedora.rb
bmhatfield-vagrant-1.0.7 lib/vagrant/hosts/fedora.rb
vagrantup-1.0.7 lib/vagrant/hosts/fedora.rb
vagrantup-1.0.6 lib/vagrant/hosts/fedora.rb
vagrantup-1.0.5 lib/vagrant/hosts/fedora.rb
vagrant-fixed-ssh-1.0.7 lib/vagrant/hosts/fedora.rb
vagrant-1.0.7 lib/vagrant/hosts/fedora.rb
vagrant-1.0.6 lib/vagrant/hosts/fedora.rb
boxcar-0.10005.1 lib/vagrant/hosts/fedora.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/vagrant-1.0.5/lib/vagrant/hosts/fedora.rb
vagrant-1.0.5 lib/vagrant/hosts/fedora.rb