'Conditionally destroy the namespace if it is empty.'

def garbage_collect_namespace(self):

    if (self.namespace and self.netns.exists(self.namespace)):
        if self.namespace_is_empty():
            self.netns.delete(self.namespace)
            return True
    return False
