easy_manager 0.9.3 → 0.9.4
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/lib/easymanager/scaleway/ips.rb +7 -2
- data/lib/easymanager/scaleway/main.rb +1 -1
- data/lib/easymanager/scaleway/servers.rb +7 -2
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: ab9a57597bbf2084e8677c0744935cfc798c99c63cc07b4503568963f11c3d55
         | 
| 4 | 
            +
              data.tar.gz: ba92b5d4810baa0bbb84348e52d8a55dd098c28f03771092d5c9c8df6a479f22
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: dd711601f7aa4bba050f61fc1be56fd48d838892a4f15bfbf15c82c4488bb2b09fbcc5e40a5f26f5b7b00b3baa19fcff47e8992ee0fdc9efc7451ed9bc4bfc87
         | 
| 7 | 
            +
              data.tar.gz: 8cd4d60852f38458df9f0379e8e2a1a5b217de125f7848ce0e4b1e79263bda328b0f588e5cb7a0882357ca4bca5741c5e084b18336870292490d92fd090884da
         | 
| @@ -18,11 +18,16 @@ class EasyManager | |
| 18 18 | 
             
                    Utilities.parse_json(response.body)
         | 
| 19 19 | 
             
                  end
         | 
| 20 20 |  | 
| 21 | 
            -
                  def self.delete(scw, ip_id)
         | 
| 22 | 
            -
                    Typhoeus.delete(
         | 
| 21 | 
            +
                  def self.delete(scw, ip_id, tries = 0)
         | 
| 22 | 
            +
                    resp = Typhoeus.delete(
         | 
| 23 23 | 
             
                      File.join(scw.api_url, "/instance/v1/zones/#{scw.zone}/ips/#{ip_id}"),
         | 
| 24 24 | 
             
                      headers: scw.headers
         | 
| 25 25 | 
             
                    )
         | 
| 26 | 
            +
                    return resp if resp&.code == 204
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                    sleep(rand(10..60))
         | 
| 29 | 
            +
                    tries += 1
         | 
| 30 | 
            +
                    delete(scw, ip_id, tries) unless tries >= 3
         | 
| 26 31 | 
             
                  end
         | 
| 27 32 | 
             
                end
         | 
| 28 33 | 
             
              end
         | 
| @@ -87,13 +87,18 @@ class EasyManager | |
| 87 87 | 
             
                    )
         | 
| 88 88 | 
             
                  end
         | 
| 89 89 |  | 
| 90 | 
            -
                  def self.action(scw, srv_id, action)
         | 
| 90 | 
            +
                  def self.action(scw, srv_id, action, tries = 0)
         | 
| 91 91 | 
             
                    data = { action: action }
         | 
| 92 | 
            -
                    Typhoeus.post(
         | 
| 92 | 
            +
                    resp = Typhoeus.post(
         | 
| 93 93 | 
             
                      File.join(scw.api_url, "/instance/v1/zones/#{scw.zone}/servers/#{srv_id}/action"),
         | 
| 94 94 | 
             
                      headers: scw.headers,
         | 
| 95 95 | 
             
                      body: data.to_json
         | 
| 96 96 | 
             
                    )
         | 
| 97 | 
            +
                    return resp if resp&.code == 202
         | 
| 98 | 
            +
             | 
| 99 | 
            +
                    sleep(rand(10..60))
         | 
| 100 | 
            +
                    tries += 1
         | 
| 101 | 
            +
                    action(scw, srv_id, action, tries) unless tries >= 3
         | 
| 97 102 | 
             
                  end
         | 
| 98 103 |  | 
| 99 104 | 
             
                  def self.srv_data(scw, srv_type, image, name_pattern)
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: easy_manager
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.9. | 
| 4 | 
            +
              version: 0.9.4
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Joshua MARTINELLE
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2022- | 
| 11 | 
            +
            date: 2022-11-08 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bcrypt_pbkdf
         |