equal
deleted
inserted
replaced
871 {'short': 'f', 'action' : 'store_true', |
871 {'short': 'f', 'action' : 'store_true', |
872 'help': 'don\'t check instance is up to date.', |
872 'help': 'don\'t check instance is up to date.', |
873 'group': 'local' |
873 'group': 'local' |
874 }), |
874 }), |
875 |
875 |
876 ('repo-uri', |
|
877 {'short': 'H', 'type' : 'string', 'metavar': '<protocol>://<[host][:port]>', |
|
878 'help': 'URI of the CubicWeb repository to connect to. URI can be \ |
|
879 a ZMQ URL or inmemory:// (default) use an in-memory repository. THIS OPTION IS DEPRECATED, \ |
|
880 directly give URI as instance id instead', |
|
881 'group': 'remote' |
|
882 }), |
|
883 ) |
876 ) |
884 |
877 |
885 def _get_mih(self, appid): |
878 def _get_mih(self, appid): |
886 """ returns migration context handler & shutdown function """ |
879 """ returns migration context handler & shutdown function """ |
887 config = cwcfg.config_for(appid) |
880 config = cwcfg.config_for(appid) |
897 mih = config.migration_handler() |
890 mih = config.migration_handler() |
898 return mih, lambda: mih.shutdown() |
891 return mih, lambda: mih.shutdown() |
899 |
892 |
900 def run(self, args): |
893 def run(self, args): |
901 appuri = args.pop(0) |
894 appuri = args.pop(0) |
902 if self.config.repo_uri: |
|
903 warn('[3.16] --repo-uri option is deprecated, directly give the URI as instance id', |
|
904 DeprecationWarning) |
|
905 if urlparse(self.config.repo_uri).scheme == 'inmemory': |
|
906 appuri = '%s/%s' % (self.config.repo_uri.rstrip('/'), appuri) |
|
907 |
|
908 mih, shutdown_callback = self._get_mih(appuri) |
895 mih, shutdown_callback = self._get_mih(appuri) |
909 try: |
896 try: |
910 with mih.cnx: |
897 with mih.cnx: |
911 with mih.cnx.security_enabled(False, False): |
898 with mih.cnx.security_enabled(False, False): |
912 if args: |
899 if args: |