Sha256: 6ee5a4f1949aaa82081d1d8ffd2cf040258cab5216caec0fc3b97148c8c85e1d

Contents?: true

Size: 623 Bytes

Versions: 1

Compression:

Stored size: 623 Bytes

Contents

module Serverspec
  module Type
    class VyosConfig < Base
      @@cli = "/bin/cli-shell-api"
      @@setup_session = "session_env=$(#{@@cli} getSessionEnv $PPID); eval ${session_env}; #{@@cli} setupSession;"
      def exists?
        res = @runner.run_command("#{@@setup_session} #{@@cli} exists #{@name};exit_code=$?;#{@@cli} teardownSession;exit $exit_code")
        res.exit_status == 0
      end
 
      def value
        @runner.run_command("#{@@setup_session} #{@@cli} returnValue #{@name}").stdout
      end
    end
    def vyos_config(name)
      VyosConfig.new(name)
    end
  end
end
 
include Serverspec::Type

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
serverspec-vyos-config-0.1.2 lib/serverspec_vyos_config/vyos_config.rb