vagrant-mos 0.8.80 → 0.8.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/vagrant-mos/action/run_instance.rb +4 -1
- data/lib/vagrant-mos/config.rb +11 -2
- data/lib/vagrant-mos/version.rb +1 -1
- data/spec/vagrant-mos/config_spec.rb +6 -1
- metadata +1 -2
- data/vagrant-mos-0.8.70.gem +0 -0
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 5384f64d4292efc8f57467849f66a7a1198a903b
         | 
| 4 | 
            +
              data.tar.gz: 2e5d749a66c42216790a72e01d76e84e7180bba0
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: bbcc9679c7b1fcc22bd5cb676eef726ebd59a0ae93ad92d83a5bd0bc69d3582a6f35a8b425ad2b754b7ab6f8ca5f4274b9d4e8e26896a282f3a9ecd99354f2ae
         | 
| 7 | 
            +
              data.tar.gz: 6a2241f63c674cdcf502098da935bab5d3f9ba704d5101d3c4543a6e252b79f83a3da56ed22bcca53c3100a9979f1eab157b050ca83f9d83d10281038122c1b7
         | 
    
        data/README.md
    CHANGED
    
    | @@ -104,6 +104,8 @@ This provider exposes quite a few provider-specific configuration options: | |
| 104 104 | 
             
            * `ami` - The image id to boot, such as "fa1026fe-c082-4ead-8458-802bf65ca64c"
         | 
| 105 105 | 
             
            * `instance_ready_timeout` - The number of seconds to wait for the instance
         | 
| 106 106 | 
             
              to become "ready" in MOS. Defaults to 120 seconds.
         | 
| 107 | 
            +
              * `instance_name` - The name of instance to be created, such as "ubuntu01". The default
         | 
| 108 | 
            +
              value of this if not specified is 'default'.
         | 
| 107 109 | 
             
            * `instance_type` - The type of instance, such as "C1_M1". The default
         | 
| 108 110 | 
             
              value of this if not specified is "C1_M2".
         | 
| 109 111 | 
             
            * `keypair_name` - The name of the keypair to use to bootstrap images
         | 
| @@ -27,6 +27,7 @@ module VagrantPlugins | |
| 27 27 | 
             
                      # Get the configs
         | 
| 28 28 | 
             
                      region_config = env[:machine].provider_config.get_region_config(region)
         | 
| 29 29 | 
             
                      ami = region_config.ami
         | 
| 30 | 
            +
                      instance_name = region_config.instance_name
         | 
| 30 31 | 
             
                      instance_type = region_config.instance_type
         | 
| 31 32 | 
             
                      keypair = region_config.keypair_name
         | 
| 32 33 | 
             
                      terminate_on_shutdown = region_config.terminate_on_shutdown
         | 
| @@ -38,6 +39,7 @@ module VagrantPlugins | |
| 38 39 |  | 
| 39 40 | 
             
                      # Launch!
         | 
| 40 41 | 
             
                      env[:ui].info(I18n.t("vagrant_mos.launching_instance"))
         | 
| 42 | 
            +
                      env[:ui].info(" -- Name: #{instance_name}") if instance_name
         | 
| 41 43 | 
             
                      env[:ui].info(" -- Type: #{instance_type}")
         | 
| 42 44 | 
             
                      env[:ui].info(" -- AMI: #{ami}")
         | 
| 43 45 | 
             
                      env[:ui].info(" -- Region: #{region}")
         | 
| @@ -46,6 +48,7 @@ module VagrantPlugins | |
| 46 48 |  | 
| 47 49 | 
             
                      options = {
         | 
| 48 50 | 
             
                          :flavor_id => instance_type,
         | 
| 51 | 
            +
                          :instance_name => instance_name,
         | 
| 49 52 | 
             
                          :image_id => ami,
         | 
| 50 53 | 
             
                          :key_name => keypair,
         | 
| 51 54 | 
             
                          :instance_initiated_shutdown_behavior => terminate_on_shutdown == true ? "terminate" : nil,
         | 
| @@ -53,7 +56,7 @@ module VagrantPlugins | |
| 53 56 |  | 
| 54 57 | 
             
                      begin
         | 
| 55 58 | 
             
                        # create a handler to access MOS
         | 
| 56 | 
            -
                        server = env[:mos_compute].create_instance(options[:image_id], options[:flavor_id], nil,  | 
| 59 | 
            +
                        server = env[:mos_compute].create_instance(options[:image_id], options[:flavor_id], nil, options[:instance_name], options[:key_name], datadisk=9, bandwidth=2)
         | 
| 57 60 | 
             
                      rescue Exception => e
         | 
| 58 61 | 
             
                        raise Errors::MosError, :message => e.message
         | 
| 59 62 | 
             
                      end
         | 
    
        data/lib/vagrant-mos/config.rb
    CHANGED
    
    | @@ -8,11 +8,16 @@ module VagrantPlugins | |
| 8 8 | 
             
                  # @return [String]
         | 
| 9 9 | 
             
                  attr_accessor :access_key_id
         | 
| 10 10 |  | 
| 11 | 
            -
                  # The ID of the  | 
| 11 | 
            +
                  # The ID of the image to use.
         | 
| 12 12 | 
             
                  #
         | 
| 13 13 | 
             
                  # @return [String]
         | 
| 14 14 | 
             
                  attr_accessor :ami
         | 
| 15 15 |  | 
| 16 | 
            +
                  # The name of the instance to create.
         | 
| 17 | 
            +
                  #
         | 
| 18 | 
            +
                  # @return [String]
         | 
| 19 | 
            +
                  attr_accessor :instance_name
         | 
| 20 | 
            +
             | 
| 16 21 | 
             
                  # The timeout to wait for an instance to become ready.
         | 
| 17 22 | 
             
                  #
         | 
| 18 23 | 
             
                  # @return [Fixnum]
         | 
| @@ -73,6 +78,7 @@ module VagrantPlugins | |
| 73 78 | 
             
                    @access_key_id             = UNSET_VALUE
         | 
| 74 79 | 
             
                    @ami                       = UNSET_VALUE
         | 
| 75 80 | 
             
                    @instance_ready_timeout    = UNSET_VALUE
         | 
| 81 | 
            +
                    @instance_name             = UNSET_VALUE
         | 
| 76 82 | 
             
                    @instance_type             = UNSET_VALUE
         | 
| 77 83 | 
             
                    @keypair_name              = UNSET_VALUE
         | 
| 78 84 | 
             
                    @region                    = UNSET_VALUE
         | 
| @@ -158,11 +164,14 @@ module VagrantPlugins | |
| 158 164 | 
             
                    # AMI must be nil, since we can't default that
         | 
| 159 165 | 
             
                    @ami = nil if @ami == UNSET_VALUE
         | 
| 160 166 |  | 
| 167 | 
            +
                    # Default instance name is nil
         | 
| 168 | 
            +
                    @instance_name = nil if @instance_name == UNSET_VALUE
         | 
| 169 | 
            +
             | 
| 161 170 | 
             
                    # Set the default timeout for waiting for an instance to be ready
         | 
| 162 171 | 
             
                    @instance_ready_timeout = 120 if @instance_ready_timeout == UNSET_VALUE
         | 
| 163 172 |  | 
| 164 173 |  | 
| 165 | 
            -
                    # Default instance type is an  | 
| 174 | 
            +
                    # Default instance type is an C1_M2
         | 
| 166 175 | 
             
                    @instance_type = "C1_M2" if @instance_type == UNSET_VALUE
         | 
| 167 176 | 
             
                    # Keypair defaults to nil
         | 
| 168 177 | 
             
                    @keypair_name = nil if @keypair_name == UNSET_VALUE
         | 
    
        data/lib/vagrant-mos/version.rb
    CHANGED
    
    
| @@ -18,6 +18,7 @@ describe VagrantPlugins::MOS::Config do | |
| 18 18 | 
             
                its("access_key_id")     { should be_nil }
         | 
| 19 19 | 
             
                its("ami")               { should be_nil }
         | 
| 20 20 | 
             
                its("instance_ready_timeout") { should == 120 }
         | 
| 21 | 
            +
                its("instance_name")     { should be_nil }
         | 
| 21 22 | 
             
                its("instance_type")     { should == "C1_M2" }
         | 
| 22 23 | 
             
                its("keypair_name")      { should be_nil }
         | 
| 23 24 | 
             
                its("region")            { should == "us-east-1" }
         | 
| @@ -33,7 +34,7 @@ describe VagrantPlugins::MOS::Config do | |
| 33 34 | 
             
                # simple boilerplate test, so I cut corners here. It just sets
         | 
| 34 35 | 
             
                # each of these attributes to "foo" in isolation, and reads the value
         | 
| 35 36 | 
             
                # and asserts the proper result comes back out.
         | 
| 36 | 
            -
                [:access_key_id, :ami, :instance_ready_timeout,
         | 
| 37 | 
            +
                [:access_key_id, :ami, :instance_ready_timeout,:instance_name,
         | 
| 37 38 | 
             
                  :instance_type, :keypair_name, :ssh_host_attribute,
         | 
| 38 39 | 
             
                  :region, :secret_access_key, :secret_access_url, :terminate_on_shutdown,
         | 
| 39 40 | 
             
                  :use_iam_profile].each do |attribute|
         | 
| @@ -87,6 +88,7 @@ describe VagrantPlugins::MOS::Config do | |
| 87 88 | 
             
                let(:config_access_key_id)     { "foo" }
         | 
| 88 89 | 
             
                let(:config_ami)               { "foo" }
         | 
| 89 90 | 
             
                let(:config_instance_type)     { "foo" }
         | 
| 91 | 
            +
                let(:config_instance_name)     { "foo" }
         | 
| 90 92 | 
             
                let(:config_keypair_name)      { "foo" }
         | 
| 91 93 | 
             
                let(:config_region)            { "foo" }
         | 
| 92 94 | 
             
                let(:config_secret_access_key) { "foo" }
         | 
| @@ -96,6 +98,7 @@ describe VagrantPlugins::MOS::Config do | |
| 96 98 | 
             
                  instance.access_key_id     = config_access_key_id
         | 
| 97 99 | 
             
                  instance.ami               = config_ami
         | 
| 98 100 | 
             
                  instance.instance_type     = config_instance_type
         | 
| 101 | 
            +
                  instance.instance_name     = config_instance_name
         | 
| 99 102 | 
             
                  instance.keypair_name      = config_keypair_name
         | 
| 100 103 | 
             
                  instance.region            = config_region
         | 
| 101 104 | 
             
                  instance.secret_access_key = config_secret_access_key
         | 
| @@ -122,6 +125,7 @@ describe VagrantPlugins::MOS::Config do | |
| 122 125 | 
             
                  its("access_key_id")     { should == config_access_key_id }
         | 
| 123 126 | 
             
                  its("ami")               { should == config_ami }
         | 
| 124 127 | 
             
                  its("instance_type")     { should == config_instance_type }
         | 
| 128 | 
            +
                  its("instance_name")     { should == config_instance_name }
         | 
| 125 129 | 
             
                  its("keypair_name")      { should == config_keypair_name }
         | 
| 126 130 | 
             
                  its("region")            { should == config_region }
         | 
| 127 131 | 
             
                  its("secret_access_key") { should == config_secret_access_key }
         | 
| @@ -147,6 +151,7 @@ describe VagrantPlugins::MOS::Config do | |
| 147 151 | 
             
                  its("access_key_id")     { should == config_access_key_id }
         | 
| 148 152 | 
             
                  its("ami")               { should == config_ami }
         | 
| 149 153 | 
             
                  its("instance_type")     { should == config_instance_type }
         | 
| 154 | 
            +
                  its("instance_name")     { should == config_instance_name }
         | 
| 150 155 | 
             
                  its("keypair_name")      { should == config_keypair_name }
         | 
| 151 156 | 
             
                  its("region")            { should == region_name }
         | 
| 152 157 | 
             
                  its("secret_access_key") { should == config_secret_access_key }
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: vagrant-mos
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.8. | 
| 4 | 
            +
              version: 0.8.81
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - yangcs2009
         | 
| @@ -139,7 +139,6 @@ files: | |
| 139 139 | 
             
            - spec/vagrant-mos/config_spec.rb
         | 
| 140 140 | 
             
            - templates/metadata.json.erb
         | 
| 141 141 | 
             
            - templates/vagrant-aws_package_Vagrantfile.erb
         | 
| 142 | 
            -
            - vagrant-mos-0.8.70.gem
         | 
| 143 142 | 
             
            - vagrant-mos.gemspec
         | 
| 144 143 | 
             
            homepage: http://www.vagrantup.com
         | 
| 145 144 | 
             
            licenses:
         | 
    
        data/vagrant-mos-0.8.70.gem
    DELETED
    
    | Binary file |