-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Bucket lock samples #1588
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
Bucket lock samples #1588
Conversation
|
||
print('Retention policy for {} is now locked'.format(bucket_name)) | ||
print('Retention policy Effective as of {}'.format( | ||
bucket.retention_policy_effective_time)) |
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.
I get this error for this line. Any ideas?
AttributeError: 'Bucket' object has no attribute 'retention_policy_effective_time'
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 lock the retention policy you should use bucket.lock_retention_policy(). Review tests in google-cloud-python PR#5534 and w.r.t to this sample please review system.py line#1268.
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.
(I updated my comment -- made a mistake 😄)
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.
General feedback for other samples. I don't see patch operations being performed which means the metadata is only being updated locally and not in the service.
System tests Ref: https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5534/files#diff-76380c4d34ce398e5075ab86d5305f5d
|
||
print('Retention policy for {} is now locked'.format(bucket_name)) | ||
print('Retention policy Effective as of {}'.format( | ||
bucket.retention_policy_effective_time)) |
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 lock the retention policy you should use bucket.lock_retention_policy(). Review tests in google-cloud-python PR#5534 and w.r.t to this sample please review system.py line#1268.
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 @billyjacobson!
I added some minor comments to the PR, lgtm overall!
Removing some unnecessary tests Generating the README Removing dependency on github branch
upgrading storage library version Updating readme
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.
Samples lgtm, pending tests.
Correcting names of commands to be dashes and not underscores Updating readme
Uh oh!
There was an error while loading. Please reload this page.