def cmd_args()

in pygenie/jobs/sqoop.py [0:0]


    def cmd_args(self):
        """
        The constructed command line arguments using the job's definition. If the
        command line arguments are set explicitly (by calling
        :py:meth:`command_arguments`) this will be the same.
        """

        if self._command_arguments is not None:
            return self._command_arguments

        hadoop_opts = ' '.join([
            '-D{name}={value}'.format(name=name, value=value)
            for name, value in self._command_options.get('-D', {}).items()])

        # put options into an options file and specify options file on command line
        # this is to get around putting bad characters (like '$') on the command line
        # which Genie's run bash script have issues with
        self._add_dependency({
            'name': '_sqoop_options.txt',
            'data': self._options_file
        })

        return '{cmd} {hadoop_opts} --options-file _sqoop_options.txt {post_cmd_args}' \
            .format(cmd=self._cmd,
                    hadoop_opts=hadoop_opts,
                    post_cmd_args=' '.join(self._post_cmd_args)) \
            .strip()