'Changes the locking state for a given version.'

def _LockingAction(self, url):

    if (len(self.args) == 1):
        appyaml = self._ParseAppInfoFromYaml(self.args[0])
        app_id = appyaml.application
        module = (appyaml.module or '')
        version = appyaml.version
    elif (not self.args):
        if (not (self.options.app_id and self.options.version)):
            self.parser.error('Expected    a    <directory>    argument    or    both    --application    and    --version    flags.')
        module = ''
    else:
        self._PrintHelpAndExit()
    if self.options.app_id:
        app_id = self.options.app_id
    if self.options.module:
        module = self.options.module
    if self.options.version:
        version = self.options.version
    rpcserver = self._GetRpcServer()
    DoLockAction(url, rpcserver, app_id, version, module, self.options.instance, self.out_fh).Do()
