def set_args(self, argv, args): self._argv = argv self._args = args self._config = miner.load_config(args.config) # set optional keys to default value self._config.setdefault('miner.pool.host', 'stratum+tcp://stratum.slushpool.com') self._config.setdefault('miner.pool.port', 3333) self._config.setdefault('miner.pool.user', 'braiinstest.worker1') self._config.setdefault('build.jobs', 1) self._config.setdefault('build.verbose', 'no') self._config.setdefault('remote.fetch', 'no') self._config.setdefault('remote.fetch_always', 'no') self._config.setdefault('uenv.mac', 'yes') self._config.setdefault('uenv.factory_reset', 'no') self._config.setdefault('uenv.sd_images', 'no') self._config.setdefault('uenv.sd_boot', 'no') # overload settings with local configuration if os.path.isfile(self.LOCAL_CONFIGURATION): config_local = miner.load_config(self.LOCAL_CONFIGURATION) self._config.merge(config_local) # change default platform in configuration if args.platform: self._config.miner.platform = args.platform
def release(self): logging.debug("Called command 'release'") if not self._args.no_fetch: # always fetch all repositories before creating release self._config.remote.fetch_always = 'yes' config_original = miner.load_config(self._args.config) builder = self.get_builder('checkout') builder.release(config_original, push=not self._args.no_push)
def get_config(args, ssh, rewrite_miner_cfg): config = miner.load_config(args.config) config.setdefault('miner', miner.EmptyDict()) config.setdefault('net', miner.EmptyDict()) if args.mac: config.net.mac = args.mac elif rewrite_miner_cfg and not config.net.get('mac'): config.net.mac = get_ethaddr(ssh) return config
def release(self): logging.debug("Called command 'release'") sysupgrade = self._config.build.sysupgrade for include in set(self._args.include or []): setattr(sysupgrade, include, 'yes') if not self._args.no_fetch: # always fetch all repositories before creating release self._config.remote.fetch_always = 'yes' config_original = miner.load_config(self._args.config) builder = self.get_builder() builder.release(config_original)
def set_args(self, argv, args): self._argv = argv self._args = args self._config = miner.load_config(args.config) # set optional keys to default value self._config.setdefault('miner.pool.host', 'stratum+tcp://stratum.slushpool.com') self._config.setdefault('miner.pool.port', 3333) self._config.setdefault('miner.pool.user', 'braiinstest.worker1') self._config.setdefault('build.jobs', 1) self._config.setdefault('build.verbose', 'no') self._config.setdefault('remote.fetch', 'no') self._config.setdefault('remote.fetch_always', 'no') self._config.setdefault('uenv.mac', 'yes') self._config.setdefault('uenv.factory_reset', 'no') self._config.setdefault('uenv.sd_images', 'no') self._config.setdefault('uenv.sd_boot', 'no') # change default platform in configuration if args.platform: self._config.miner.platform = args.platform