<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ip_cmd(self, name):
 """ Print ip of given container """

        if not self.container_exists(name=name):
            exit('Unknown container {0}'.format(name))

        ip = self.get_container_ip(name)
        if not ip:
            exit("Failed to get network address for"
                 " container {0}".format(name))
        else:
            echo(ip)