Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
Reverts patch: GET and LIST return some empty fields
Browse files Browse the repository at this point in the history
This patch reverts patch 576c5ec.
The previous patch introduced new bugs in PATCH, while trying to
add support for fields http_method, client_ip, http_host.

Change-Id: Iee7a64b618e04bd7689d03bd5b179773a6861874
  • Loading branch information
Obulpathi committed Jan 19, 2015
1 parent 1033495 commit ed7eeac
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
40 changes: 16 additions & 24 deletions poppy/storage/cassandra/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,33 +564,25 @@ def format_result(result):
domains = [domain.Domain(d['domain'], d.get('protocol', 'http'))
for d in domains]

restriction_objects = []
for r in restrictions:
restriction_object = restriction.Restriction(r.get('name'))
restriction_object.rules = []
for r_rule in r['rules']:
rule_object = rule.Rule(r_rule.get('name'))
del r_rule['name']
rule_object.from_dict(r_rule)
restriction_object.rules.append(rule_object)
restriction_objects.append(restriction_object)

caching_objects = []
for caching_rule in caching_rules:
caching_object = cachingrule.CachingRule(caching_rule.get('name'),
caching_rule.get('ttl'))
caching_object.rules = []
for cr_rule in caching_rule['rules']:
rule_object = rule.Rule(cr_rule.get('name'))
del cr_rule['name']
rule_object.from_dict(cr_rule)
caching_object.rules.append(rule_object)
caching_objects.append(caching_object)
restrictions = [restriction.Restriction(
r.get('name'),
[rule.Rule(r_rule.get('name'),
referrer=r_rule.get('referrer'))
for r_rule in r['rules']])
for r in restrictions]

caching_rules = [cachingrule.CachingRule(
caching_rule.get('name'),
caching_rule.get('ttl'),
[rule.Rule(rule_i.get('name'),
request_url=rule_i.get('request_url'))
for rule_i in caching_rule['rules']])
for caching_rule in caching_rules]

# create the service object
s = service.Service(service_id, name, domains, origins, flavor_id,
caching=caching_objects,
restrictions=restriction_objects)
caching=caching_rules,
restrictions=restrictions)

# format the provider details
provider_detail_results = result.get('provider_details') or {}
Expand Down
3 changes: 1 addition & 2 deletions tests/api/services/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,7 @@ def setUp(self):
u"ttl": 1200,
u"rules": [{
u"name": u"index",
u"request_url": u"/index.htm",
u"http_method": u"GET"
u"request_url": u"/index.htm"
}]
}
]
Expand Down

0 comments on commit ed7eeac

Please sign in to comment.