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

Side by Side Diff: third_party/gsutil/boto/ec2/elb/policies.py

Issue 12042069: Scripts to download files from google storage based on sha1 sums (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Removed gsutil/tests and gsutil/docs Created 7 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright (c) 2010 Reza Lotun http://reza.lotun.name
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the
5 # "Software"), to deal in the Software without restriction, including
6 # without limitation the rights to use, copy, modify, merge, publish, dis-
7 # tribute, sublicense, and/or sell copies of the Software, and to permit
8 # persons to whom the Software is furnished to do so, subject to the fol-
9 # lowing conditions:
10 #
11 # The above copyright notice and this permission notice shall be included
12 # in all copies or substantial portions of the Software.
13 #
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
16 # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
17 # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 # IN THE SOFTWARE.
21
22 from boto.resultset import ResultSet
23
24
25 class AppCookieStickinessPolicy(object):
26 def __init__(self, connection=None):
27 self.cookie_name = None
28 self.policy_name = None
29
30 def __repr__(self):
31 return 'AppCookieStickiness(%s, %s)' % (self.policy_name,
32 self.cookie_name)
33
34 def startElement(self, name, attrs, connection):
35 pass
36
37 def endElement(self, name, value, connection):
38 if name == 'CookieName':
39 self.cookie_name = value
40 elif name == 'PolicyName':
41 self.policy_name = value
42
43
44 class LBCookieStickinessPolicy(object):
45 def __init__(self, connection=None):
46 self.policy_name = None
47 self.cookie_expiration_period = None
48
49 def __repr__(self):
50 return 'LBCookieStickiness(%s, %s)' % (self.policy_name,
51 self.cookie_expiration_period)
52
53 def startElement(self, name, attrs, connection):
54 pass
55
56 def endElement(self, name, value, connection):
57 if name == 'CookieExpirationPeriod':
58 self.cookie_expiration_period = value
59 elif name == 'PolicyName':
60 self.policy_name = value
61
62
63 class Policies(object):
64 """
65 ELB Policies
66 """
67 def __init__(self, connection=None):
68 self.connection = connection
69 self.app_cookie_stickiness_policies = None
70 self.lb_cookie_stickiness_policies = None
71
72 def __repr__(self):
73 app = 'AppCookieStickiness%s' % self.app_cookie_stickiness_policies
74 lb = 'LBCookieStickiness%s' % self.lb_cookie_stickiness_policies
75 return 'Policies(%s,%s)' % (app, lb)
76
77 def startElement(self, name, attrs, connection):
78 if name == 'AppCookieStickinessPolicies':
79 rs = ResultSet([('member', AppCookieStickinessPolicy)])
80 self.app_cookie_stickiness_policies = rs
81 return rs
82 elif name == 'LBCookieStickinessPolicies':
83 rs = ResultSet([('member', LBCookieStickinessPolicy)])
84 self.lb_cookie_stickiness_policies = rs
85 return rs
86
87 def endElement(self, name, value, connection):
88 return
89
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698