Make Service&File entries representation human-readable.

This will help in debugging and writing web-tests.

Implements blueprint human-readable-metadata-list
Change-Id: I748b19710f8590c6dee5e2e98e69aa8d74bb324a
This commit is contained in:
Timur Sufiev 2014-03-06 19:26:28 +04:00
parent 554c95e77c
commit 55dfd0f441
1 changed files with 10 additions and 0 deletions

View File

@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import StringIO
import types
from os.path import dirname, basename
from metadataclient import exc
@ -24,6 +25,15 @@ class Wrapper(object):
for key, value in kwargs.items():
setattr(self, key, value)
def __str__(self):
if isinstance(self.id, types.StringTypes):
return self.id.replace('##', '/')
else:
return str(self.id)
def __repr__(self):
return 'RowWrapper({0})'.format(str(self))
class Controller(object):
def __init__(self, http_client):