diff --git a/novatools/base.py b/novatools/base.py index fce18553c..10c28d21e 100644 --- a/novatools/base.py +++ b/novatools/base.py @@ -109,7 +109,8 @@ class Resource(object): def get(self): new = self.manager.get(self.id) - self._add_details(new._info) + if new: + self._add_details(new._info) def __eq__(self, other): if not isinstance(other, self.__class__): diff --git a/novatools/shell.py b/novatools/shell.py index 4a11f549c..733cfcf8f 100644 --- a/novatools/shell.py +++ b/novatools/shell.py @@ -491,11 +491,6 @@ class OpenStackShell(object): @arg('--password', dest='password', default=None, help='New password.') def do_zone(self, args): """Show or edit a child zone. No zone arg for this zone.""" - if args.zone == None: - zone = self.cs.zones.info() - print_dict(zone) - return - zone = self.cs.zones.get(args.zone) # If we have some flags, update the zone @@ -511,6 +506,11 @@ class OpenStackShell(object): else: print_dict(zone._info) + def do_zone_info(self, args): + """Get this zones name and capabilities.""" + zone = self.cs.zones.info() + print_dict(zone._info) + @arg('api_url', metavar='<api_url>', help="URL for the Zone's API") @arg('zone_username', metavar='<zone_username>', help='Authentication username.') diff --git a/novatools/zones.py b/novatools/zones.py index e370123e6..3a171cb96 100644 --- a/novatools/zones.py +++ b/novatools/zones.py @@ -31,7 +31,7 @@ class ZoneManager(base.ManagerWithFind): :rtype: :class:`Zone` """ - return self._get("/zones/", "zone") + return self._get("/zones/info", "zone") def get(self, zone): """