st2common/st2common/models/system/action.py
def _get_script_arguments(self, named_args=None, positional_args=None):
        """
        Build a string of named and positional arguments which are passed to the
        script.

        :param named_args: Dictionary with named arguments.
        :type named_args: ``dict``.

        :param positional_args: List with positional arguments.
        :type positional_args: ``dict``.

        :rtype: ``str``
        """
        command_parts = []

        # add all named_args in the format <kwarg_op>name=value (e.g. --name=value)
        if named_args is not None:
            for (arg, value) in six.iteritems(named_args):
                if value is None or (isinstance(value, (str, unicode)) and len(value) < 1):
                    LOG.debug('Ignoring arg %s as its value is %s.', arg, value)
                    continue

                if isinstance(value, bool):
                    if value is True:
                        command_parts.append(arg)
                else:
                    values = (quote_unix(arg), quote_unix(six.text_type(value)))
                    command_parts.append(six.text_type('%s=%s' % values))

        # add the positional args
        if positional_args:
            quoted_pos_args = [quote_unix(pos_arg) for pos_arg in positional_args]
            pos_args_string = ' '.join(quoted_pos_args)
            command_parts.append(pos_args_string)
        return ' '.join(command_parts)

        Build a string of named and positional arguments which are passed to the
        script.

        :param named_args: Dictionary with named arguments.
        :type named_args: ``dict``.

        :param positional_args: List with positional arguments.
        :type positional_args: ``dict``.

        :rtype: ``str``
        
Build a string of named and positional arguments which are passed to the
script.
Build a string of named and positional arguments which are passed to the script .
def _get_script_arguments(self, named_args=None, positional_args=None):
        command_parts = []
        if named_args is not None:
            for (arg, value) in six.iteritems(named_args):
                if value is None or (isinstance(value, (str, unicode)) and len(value) < 1):
                    LOG.debug('Ignoring arg %s as its value is %s.', arg, value)
                    continue
                if isinstance(value, bool):
                    if value is True:
                        command_parts.append(arg)
                else:
                    values = (quote_unix(arg), quote_unix(six.text_type(value)))
                    command_parts.append(six.text_type('%s=%s' % values))
        if positional_args:
            quoted_pos_args = [quote_unix(pos_arg) for pos_arg in positional_args]
            pos_args_string = ' '.join(quoted_pos_args)
            command_parts.append(pos_args_string)
        return ' '.join(command_parts)
def _get_script_arguments ( self , named_args = None , positional_args = None ) : command_parts = [ ] if named_args is not None : for ( arg , value ) in six . iteritems ( named_args ) : if value is None or ( isinstance ( value , ( str , unicode ) ) and len ( value ) < 1 ) : LOG . debug ( 'Ignoring arg %s as its value is %s.' , arg , value ) continue if isinstance ( value , bool ) : if value is True : command_parts . append ( arg ) else : values = ( quote_unix ( arg ) , quote_unix ( six . text_type ( value ) ) ) command_parts . append ( six . text_type ( '%s=%s' % values ) ) if positional_args : quoted_pos_args = [ quote_unix ( pos_arg ) for pos_arg in positional_args ] pos_args_string = ' ' . join ( quoted_pos_args ) command_parts . append ( pos_args_string ) return ' ' . join ( command_parts )
Build a string of named and positional arguments which are passed to the
script.
Build a string of named and positional arguments which are passed to the script .
"""
        Build a string of named and positional arguments which are passed to the
        script.

        :param named_args: Dictionary with named arguments.
        :type named_args: ``dict``.

        :param positional_args: List with positional arguments.
        :type positional_args: ``dict``.

        :rtype: ``str``
        """ # add all named_args in the format <kwarg_op>name=value (e.g. --name=value) # add the positional args
None
``str``
self
named_args
Dictionary with named arguments.
Dictionary with named arguments .
positional_args
List with positional arguments.
List with positional arguments .