Revision 698306b8
b/snf-cyclades-app/setup.py | ||
---|---|---|
81 | 81 |
'snf-pithos-backend>=0.11', |
82 | 82 |
'lockfile>=0.8, <0.9', |
83 | 83 |
'ipaddr', |
84 |
'bitarray' |
|
84 |
'bitarray>=0.8'
|
|
85 | 85 |
] |
86 | 86 |
|
87 | 87 |
EXTRAS_REQUIRES = { |
b/snf-cyclades-app/synnefo/db/migrations/0052_migrate_pool_entries.py | ||
---|---|---|
13 | 13 |
return ba |
14 | 14 |
|
15 | 15 |
def bitarray_to_string(bitarray_): |
16 |
return b64encode(bitarray_.tostring())
|
|
16 |
return b64encode(bitarray_.tobytes())
|
|
17 | 17 |
|
18 | 18 |
def validate_mac(value): |
19 | 19 |
hex_ = value.replace(":", "") |
b/snf-cyclades-app/synnefo/db/pools/__init__.py | ||
---|---|---|
157 | 157 |
|
158 | 158 |
def _bitarray_from_string(bitarray_): |
159 | 159 |
ba = bitarray() |
160 |
ba.fromstring(b64decode(bitarray_))
|
|
160 |
ba.frombytes(b64decode(bitarray_))
|
|
161 | 161 |
return ba |
162 | 162 |
|
163 | 163 |
|
164 | 164 |
def _bitarray_to_string(bitarray_): |
165 |
return b64encode(bitarray_.tostring())
|
|
165 |
return b64encode(bitarray_.tobytes())
|
|
166 | 166 |
|
167 | 167 |
## |
168 | 168 |
## Custom pools |
Also available in: Unified diff