def METHOD_NAME(self, subcmd, opts):
    """${cmd_name}: update and solve for given scope
    ${cmd_usage}
    ${cmd_option_list}
    """
    if opts.staging:
        match = re.match('(.*):Staging:(.*)', opts.staging)
        opts.scope = 'staging:' + match.group(2)
        if opts.project:
            raise ValueError('--staging and --project conflict')
        opts.project = match.group(1)
    elif not opts.project:
        raise ValueError('project is required')
    if not opts.scope:
        raise ValueError('--scope or --staging required')
    apiurl = conf.config['apiurl']
    Config(apiurl, opts.project)
    target_config = conf.config[opts.project]
    # Store target project as opts.project will contain subprojects.
    target_project = opts.project
    api = StagingAPI(apiurl, target_project)
    main_repo = target_config['main-repo']
    # used by product converter
    # these needs to be kept in sync with OBS config
    if apiurl.find('suse.de') > 0:
        os.environ['OBS_NAME'] = 'build.suse.de'
    if apiurl.find('opensuse.org') > 0:
        os.environ['OBS_NAME'] = 'build.opensuse.org'
    def solve_project(project, scope: str):
        try:
            self.tool.reset()
            self.tool.dry_run = self.options.dry
            return self.tool.update_and_solve_target(api, target_project, target_config, main_repo,
                                                     project=project, scope=scope, force=opts.force,
                                                     no_checkout=opts.no_checkout,
                                                     only_release_packages=opts.only_release_packages,
                                                     stop_after_solve=opts.stop_after_solve)
        except MismatchedRepoException:
            logging.error("Failed to create weakremovers.inc due to mismatch in repos - project most likey started building again.")
            # for stagings we have to be strict on the exit value
            if scope == 'staging':
                return 1
            return 0
    scope = opts.scope
    if scope.startswith('staging:'):
        letter = re.match('staging:(.*)', scope).group(1)
        return solve_project(api.prj_from_short(letter), 'staging')
    elif scope == 'target':
        return solve_project(target_project, scope)
    elif scope == 'ring1':
        return solve_project(api.rings[1], scope)
    else:
        raise ValueError('scope "{}" must be one of: {}'.format(scope, ', '.join(self.SCOPES)))