~crunch.io/ubuntu/precise/awscli/unstable

« back to all changes in this revision

Viewing changes to awscli/customizations/emr/createcluster.py

  • Committer: Package Import Robot
  • Author(s): TANIGUCHI Takaki
  • Date: 2015-01-13 23:09:28 UTC
  • mfrom: (3.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20150113230928-uc9exkzqb17ogig0
Tags: 1.7.0-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
        bootstrap_actions = []
108
108
        params['Name'] = parsed_args.name
109
109
 
 
110
        service_role_validation_message = (
 
111
            " Either choose --use-default-roles or use both --service-role "
 
112
            "<roleName> and --ec2-attributes InstanceProfile=<profileName>.")
 
113
 
 
114
        if parsed_args.use_default_roles is True and \
 
115
                parsed_args.service_role is not None:
 
116
                raise exceptions.MutualExclusiveOptionError(
 
117
                    option1="--use-default-roles",
 
118
                    option2="--service-role",
 
119
                    message=service_role_validation_message)
 
120
 
 
121
        if parsed_args.use_default_roles is True and \
 
122
                parsed_args.ec2_attributes is not None and \
 
123
                'InstanceProfile' in parsed_args.ec2_attributes:
 
124
                raise exceptions.MutualExclusiveOptionError(
 
125
                    option1="--use-default-roles",
 
126
                    option2="--ec2-attributes InstanceProfile",
 
127
                    message=service_role_validation_message)
 
128
 
110
129
        instances_config = {}
111
130
        instances_config['InstanceGroups'] = \
112
131
            instancegroupsutils.validate_and_build_instance_groups(
122
141
        emrutils.apply_dict(
123
142
            params, 'AdditionalInfo', parsed_args.additional_info)
124
143
        emrutils.apply_dict(params, 'LogUri', parsed_args.log_uri)
 
144
 
125
145
        if parsed_args.use_default_roles is True:
126
146
            parsed_args.service_role = EMR_ROLE_NAME
127
147
            if parsed_args.ec2_attributes is None:
327
347
        return emrutils.build_step(
328
348
            name=constants.DEBUGGING_NAME,
329
349
            action_on_failure=constants.TERMINATE_CLUSTER,
330
 
            jar=emrutils.get_script_runner(),
 
350
            jar=emrutils.get_script_runner(parsed_globals.region),
331
351
            args=[emrutils.build_s3_link(
332
352
                relative_path=constants.DEBUGGING_PATH,
333
353
                region=parsed_globals.region)])