Return an object by name, if name is None the
        first found object is returned

def get_obj(self, vimtype, name, folder=None):
        """
        Return an object by name, if name is None the
        first found object is returned
        """
        obj = None
        content = self.service_instance.RetrieveContent()

        if folder is None:
            folder = content.rootFolder

        container = content.viewManager.CreateContainerView(folder, [vimtype], True)
        for c in container.view:
            if c.name == name:
                obj = c
                break

        container.Destroy()
        return obj