dc0eb66a399d49e13b7e6beda0f726737eedb520,perfkitbenchmarker/providers/digitalocean/digitalocean_virtual_machine.py,DigitalOceanVirtualMachine,_Delete,#DigitalOceanVirtualMachine#,162

Before Change


    // ID for the deletion just issued.
    stdout, ret = util.RunCurlCommand(
        "GET", "droplets/%s/actions" % self.droplet_id)
    if ret != 0:
      // There"s a race condition here - if the lookup fails, assume it"s
      // due to deletion already being complete. Don"t raise an error in
      // that case,  the _Exists check should trigger retry if needed.
      return
    response = json.loads(stdout)["actions"]

    // Get the action ID for the "destroy" action. This assumes there"s only
    // one of them, but AFAIK there can"t be more since "destroy" locks the VM.
    destroy = [v for v in response if v["type"] == "destroy"][0]

    // Wait for completion. Actions are global objects, so the action
    // status should still be retrievable after the VM got destroyed.
    // We don"t care about the result, let the _Exists check decide if we

After Change


  def _Delete(self):
    Delete a DigitalOcean VM instance.

    response, retcode = util.DoctlAndParse(
        ["compute", "droplet", "delete", self.droplet_id])
    // The command doesn"t return the HTTP status code, and the error
    // format is very difficult to parse, so we string search.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: dc0eb66a399d49e13b7e6beda0f726737eedb520
Time: 2016-09-06
Author: nlavine@google.com
File Name: perfkitbenchmarker/providers/digitalocean/digitalocean_virtual_machine.py
Class Name: DigitalOceanVirtualMachine
Method Name: _Delete


Project Name: open-mmlab/mmdetection
Commit Name: f0644d7d7137a0f7369616ed1740379e47a918cf
Time: 2020-03-19
Author: melikovk@gmail.com
File Name: tools/test.py
Class Name: MultipleKVAction
Method Name: __call__


Project Name: pantsbuild/pants
Commit Name: 676c0e80b90e2e6293f7204db8cb57a412c53d8f
Time: 2014-12-08
Author: benjyw@gmail.com
File Name: src/python/pants/option/custom_types.py
Class Name:
Method Name: dict_type