Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: third_party/gsutil/boto/bin/bundle_image

Issue 12317103: Added gsutil to depot tools (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/gsutil/boto/bin/asadmin ('k') | third_party/gsutil/boto/bin/cfadmin » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/gsutil/boto/bin/bundle_image
diff --git a/third_party/gsutil/boto/bin/bundle_image b/third_party/gsutil/boto/bin/bundle_image
new file mode 100755
index 0000000000000000000000000000000000000000..70969790826850c08b7bc39867406e75b7a1ee87
--- /dev/null
+++ b/third_party/gsutil/boto/bin/bundle_image
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+from boto.manage.server import Server
+if __name__ == "__main__":
+ from optparse import OptionParser
+ parser = OptionParser(version="%prog 1.0", usage="Usage: %prog [options] instance-id [instance-id-2]")
+
+ # Commands
+ parser.add_option("-b", "--bucket", help="Destination Bucket", dest="bucket", default=None)
+ parser.add_option("-p", "--prefix", help="AMI Prefix", dest="prefix", default=None)
+ parser.add_option("-k", "--key", help="Private Key File", dest="key_file", default=None)
+ parser.add_option("-c", "--cert", help="Public Certificate File", dest="cert_file", default=None)
+ parser.add_option("-s", "--size", help="AMI Size", dest="size", default=None)
+ parser.add_option("-i", "--ssh-key", help="SSH Keyfile", dest="ssh_key", default=None)
+ parser.add_option("-u", "--user-name", help="SSH Username", dest="uname", default="root")
+ parser.add_option("-n", "--name", help="Name of Image", dest="name")
+ (options, args) = parser.parse_args()
+
+ for instance_id in args:
+ try:
+ s = Server.find(instance_id=instance_id).next()
+ print "Found old server object"
+ except StopIteration:
+ print "New Server Object Created"
+ s = Server.create_from_instance_id(instance_id, options.name)
+ assert(s.hostname is not None)
+ b = s.get_bundler(uname=options.uname)
+ b.bundle(bucket=options.bucket,prefix=options.prefix,key_file=options.key_file,cert_file=options.cert_file,size=int(options.size),ssh_key=options.ssh_key)
« no previous file with comments | « third_party/gsutil/boto/bin/asadmin ('k') | third_party/gsutil/boto/bin/cfadmin » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698