Sha256: d8e22f644ca133680fb098ee55f55aae391af539ea85aaaa8bdd131f585a814c

Contents?: true

Size: 1.07 KB

Versions: 16

Compression:

Stored size: 1.07 KB

Contents

module Mccloud::Provider
  module Aws
    module IpCommand

      def associate(options)
        unless raw.nil?
          env.ui.info "[#{@name}] Attempting to associate ip #{@name} with vm name #{@vmname}"
          vm=env.config.vms[@vmname]
          if vm.nil?
            env.ui.error "[#{@name}] vm #{@vmname} is not defined"
            return
          else
            if vm.id.nil?
              env.ui.error "[#{@name}] vm #{@vmname} is not yet instantiated"
              return
            else
              env.ui.info "[#{@name}] The ipaddress currently has server_id #{raw.server_id} associated" unless raw.server_id.nil?
              if raw.server_id==vm.id
                env.ui.info "[#{@name}] #{@address} is already associated with #{@vmname} #{vm.id}"
              else
                env.ui.info "[#{@name}] Associating #{@address} with #{@vmname} #{vm.id}"
                raw.server=vm.raw
              end
            end
          end
        else
          env.ui.error "[#{ip.name}] Ipaddress does not (yet) exist"
        end
      end

    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mccloud-0.1.1 lib/mccloud/provider/aws/ip/associate.rb
mccloud-0.0.28 lib/mccloud/provider/aws/ip/associate.rb
mccloud-0.0.27 lib/mccloud/provider/aws/ip/associate.rb
mccloud-0.0.26 lib/mccloud/provider/aws/ip/associate.rb
mccloud-0.0.25 lib/mccloud/provider/aws/ip/associate.rb
mccloud-0.0.24 lib/mccloud/provider/aws/ip/associate.rb
mccloud-0.0.23 lib/mccloud/provider/aws/ip/associate.rb
mccloud-0.0.22 lib/mccloud/provider/aws/ip/associate.rb
mccloud-0.0.21 lib/mccloud/provider/aws/ip/associate.rb
mccloud-0.0.20 lib/mccloud/provider/aws/ip/associate.rb
mccloud-0.0.19 lib/mccloud/provider/aws/ip/associate.rb
mccloud-0.0.18 lib/mccloud/provider/aws/ip/associate.rb
mccloud-0.0.17 lib/mccloud/provider/aws/ip/associate.rb
mccloud-0.0.16 lib/mccloud/provider/aws/ip/associate.rb
mccloud-0.0.15 lib/mccloud/provider/aws/ip/associate.rb
mccloud-0.0.14 lib/mccloud/provider/aws/ip/associate.rb