Revision 4bd19308
b/snf-common/synnefo/util/entry_points.py | ||
---|---|---|
104 | 104 |
|
105 | 105 |
if type(row) == dict and (row.get('before', False) or |
106 | 106 |
row.get('after', False)): |
107 |
|
|
108 |
insert_at = len(settings_object) |
|
107 | 109 |
if row.get('before', False): |
108 |
position = settings_object.index(row.get('before')) |
|
109 |
insert_at = position - 1 |
|
110 |
try: |
|
111 |
position = settings_object.index(row.get('before')) |
|
112 |
insert_at = position - 1 |
|
113 |
except ValueError: |
|
114 |
pass |
|
110 | 115 |
else: |
111 |
position = settings_object.index(row.get('after')) |
|
112 |
insert_at = position + 1 |
|
116 |
try: |
|
117 |
position = settings_object.index(row.get('after')) |
|
118 |
insert_at = position + 1 |
|
119 |
except ValueError: |
|
120 |
pass |
|
113 | 121 |
|
114 | 122 |
if insert_at < 0: |
115 | 123 |
insert_at = 0 |
Also available in: Unified diff