Skip to content
This repository has been archived by the owner on Oct 11, 2018. It is now read-only.

provider/sl: fixes for copy #28

Merged
merged 2 commits into from
Jan 10, 2016
Merged

provider/sl: fixes for copy #28

merged 2 commits into from
Jan 10, 2016

Conversation

rjeczalik
Copy link
Contributor

Hey @fatih!

Various fixes for the Softlayer client, improves support for copying the images across datacenters.

Tested manually with all datacenters, funny fact - it does not work with dal02, dal04 and dal07 as Softlayer claims they're not valid datacenters (:D).

$  for d in dal02 dal04 dal07; do  echo "copying to $d"; sleep 2; images copy -id $SOME_ID -to "$d"; done
copying to dal02
You must provide a valid location id. Location id provided: 154770 (code="SoftLayer_Exception_Public")
copying to dal04
You must provide a valid location id. Location id provided: 167092 (code="SoftLayer_Exception_Public")
copying to dal07
You must provide a valid location id. Location id provided: 142776 (code="SoftLayer_Exception_Public")

Besides that works pretty good.

Happy New Year!

Fixes the following Softlayer API error:

  There are no existing source locations available for image template
  transfer. (code="SoftLayer_Exception_Public")
Fixes the following Softlayer API error:

  There is currently an outstanding transaction for this image template.
  (code="SoftLayer_Exception_Virtual_Guest_Block_Device_Template_Group_ActiveTransactionExists")
return nil
}

time.Sleep(5 * time.Second)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why didn't you use time.Tick() together with timeout. So it would test every 5 seconds, but if there is any timeout it would just return.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm don't know how to user ticker to not have to wait the first tick - if there's no transactions in progress the above loop returns right away, with ticker it'll sleep initial 5s regardless of the state.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. I think I new a solution for it but it's not worth it. Thanks for the hard work btw, much appreciated. Merging it :)

@fatih
Copy link
Owner

fatih commented Jan 9, 2016

Hi @rjeczalik Thanks! Sorry for the late response, I just could look at it :) This looks very good, LGTM. Just added a note, let me know what you think about it.

fatih added a commit that referenced this pull request Jan 10, 2016
@fatih fatih merged commit 55ee3a7 into fatih:master Jan 10, 2016
@rjeczalik rjeczalik deleted the sl-copy-fixes branch January 10, 2016 08:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants