-
Notifications
You must be signed in to change notification settings - Fork 924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LIBCLOUD-802] Add drivers for Aliyun cloud #712
[LIBCLOUD-802] Add drivers for Aliyun cloud #712
Conversation
First thanks for the contribution! We will look into it as soon as possible. In the mean time, since this is a larger contribution, please make sure you file an ICLA with Apache - https://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes and please let us know when you have done so. |
0768765
to
813bb50
Compare
@Kami I have signed icla and email the pdf to secretary@apache.org. |
813bb50
to
3a13316
Compare
@samsong8610 Great, thanks! It seems like that build was already triggered on force push (https://travis-ci.org/apache/libcloud - last build was started an hour ago). It looks like there are still same unicode related issues in Python 3.2, I will look into it later. |
class ObjectTestCase(unittest.TestCase): | ||
def test_object_with_chinese_name(self): | ||
driver = OSSStorageDriver(*STORAGE_OSS_PARAMS) | ||
obj = Object(name=u'中文', size=0, hash=None, extra=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing this to use libcloud.utils.py3.u
wrapper function should fix the test failure under Python 3.2.
So:
from libcloud.utils.py3 import u
...
obj = Object(name=u('中文'), size=0, hash=None, extra=None,
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your help. But py3.u wrapper function doesn't work when I compare an unicode literal to a variable which stores an unicode string.
I fixed the failed test cases according to Stackoverflow. Is it acceptable in libcloud?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's weird. I quickly tested it under Python 3.2 and it seemed to work OK (I didn't test other versions though).
Problem with unicode_literals
is that we still support Python 2.5 where this functionality is not available (sadly we don't run 2.5 tests on Travis since Travis CI doesn't support 2.5 anymore).
In any case, consider this problem solved for now. I will try to figure out something when reviewing and merging this PR. In the worst case we can just use unicode_literals
since we will probably drop support for Python 2.5 in Libcloud v1.0.0 anyway.
e50e4cd
to
608ff12
Compare
608ff12
to
bb4023c
Compare
'accomplished': VolumeSnapshotState.AVAILABLE, | ||
'failed': VolumeSnapshotState.ERROR} | ||
|
||
def list_nodes(self, ex_node_ids=[], ex_filters=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor thing - please don't default to a mutable type (list).
Rather to ex_node_ids=None
and inside method body: ex_node_ids = ex_node_ids or []
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
I've added some comments. Overall, very nice work 👍 After you look into / address those comments, could you please also add some documentation for those drivers? |
@samsong8610 Did you select to notify Libcloud project on the ICLA form? I'm wondering, because I still didn't receive an email notification about the signed ICLA, maybe ASF secretary is just busy... Edit: I do see it under "Unlisted CLAs" here - https://people.apache.org/committer-index.html (unless that's some other Sam Song :)). |
@Kami It's my fault. I didn't fill the 'notify project' field. I will re-sign the ICLA. |
Use immutable value for argument default Prefer explicit arguments to kwargs Add ALIYUN_ prefix to providers constant
715a766
to
9d834da
Compare
@samsong8610 Sorry for the delay, I was traveling. I will look into reviewing it again and merging it ASAP (tomorrow). |
78ea780
to
d98cbdc
Compare
d98cbdc
to
bf62237
Compare
@@ -64,6 +65,7 @@ class Provider(object): | |||
KTUCLOUD = 'ktucloud' | |||
AURORAOBJECTS = 'auroraobjects' | |||
BACKBLAZE_B2 = 'backblaze_b2' | |||
ALIYUN_OSS = 'oss' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid potential conflict in the future, I will prefix type values for all the Aliyun providers with "aliyun_", so "aliyun_oss" in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use immutable value for argument default Prefer explicit arguments to kwargs Add ALIYUN_ prefix to providers constant Closes #712 Signed-off-by: Tomaz Muraus <tomaz@tomaz.me>
Signed-off-by: Tomaz Muraus <tomaz@tomaz.me> Closes #712
I went ahead and merged changes into trunk. Thanks again for this very complete and high-quality contribution! |
Glad to help the libcloud. Thanks for your review. |
https://issues.apache.org/jira/browse/LIBCLOUD-802