'Ensure a container is restarted.
If the container does not exist the container will be created.
:param count: number of times this command has been called by itself.
:type count: ``int``'

def _restarted(self, count=0):

    self.check_count(count=count, method='restart')
    if self._container_exists(container_name=self.container_name, lxc_path=self.lxc_path):
        self._execute_command()
        self._config()
        if (self._get_state() != 'stopped'):
            self.container.stop()
            self.state_change = True
        self._container_startup()
        self._check_archive()
        self._check_clone()
    else:
        self._create()
        count += 1
        self._restarted(count)
