def testReadEnvYaml(self): env = {'hello': 'world', 'foo': 'bar'} output_dir = self.CreateTempDir() util.WriteEnvYaml(env, output_dir) yaml_env = util.ReadEnvYaml(output_dir) self.assertEqual(env, yaml_env)
def Run(self, args): if not args.host_port: args.host_port = arg_parsers.HostPort.Parse(util.GetHostPort( pubsub_util.PUBSUB), ipv6_enabled=True) with pubsub_util.Start(args) as pubsub_process: util.WriteEnvYaml(pubsub_util.GetEnv(args), args.data_dir) util.PrefixOutput(pubsub_process, pubsub_util.PUBSUB)
def testWriteEnvYaml(self): env = {'hello': 'world', 'foo': 'bar'} output_dir = self.CreateTempDir() util.WriteEnvYaml(env, output_dir) env_file_path = os.path.join(output_dir, 'env.yaml') yaml_env = yaml.load_path(env_file_path) self.assertEqual(env, yaml_env)
def WriteGCDEnvYaml(args): """Writes the env.yaml file for the datastore emulator with provided args. Args: args: Arguments passed to the start command. """ host_port = '{0}:{1}'.format(args.host_port.host, args.host_port.port) project_id = properties.VALUES.core.project.Get(required=True) env = {'DATASTORE_HOST': 'http://{0}'.format(host_port), 'DATASTORE_EMULATOR_HOST': host_port, 'DATASTORE_EMULATOR_HOST_PATH': '{0}/datastore'.format(host_port), 'DATASTORE_DATASET': project_id, 'DATASTORE_PROJECT_ID': project_id, } util.WriteEnvYaml(env, args.data_dir)
def Start(args): spanner_args = _BuildStartArgs(args) log.status.Print('Executing: {0}'.format(' '.join(spanner_args))) with util.Exec(spanner_args) as spanner_process: util.WriteEnvYaml(GetEnv(args), GetDataDir()) util.PrefixOutput(spanner_process, SPANNER_EMULATOR_COMPONENT_ID)
def Start(args): bigtable_args = BuildStartArgs(util.BuildArgsList(args)) log.status.Print('Executing: {0}'.format(' '.join(bigtable_args))) with util.Exec(bigtable_args) as bigtable_process: util.WriteEnvYaml(GetEnv(args), GetDataDir()) util.PrefixOutput(bigtable_process, BIGTABLE)