(self, variables, default='')
return smart_text(instance_id)
Retrieve the instance ID from the given dict of host variables.

        The instance ID variable may be specified as 'foo.bar', in which case
        the lookup will traverse into nested dicts, equivalent to:

        from_dict.get('foo', {}).get('bar', default)

        Multiple ID variables may be specified as 'foo.bar,foobar', so that
        it will first try to find 'bar' inside of 'foo', and if unable,
        will try to find 'foobar' as a fallback
Retrieve the instance ID from the given dict of host variables.
Retrieve the instance ID from the given dict of host variables .
def _get_instance_id(self, variables, default=''):
        """
        Retrieve the instance ID from the given dict of host variables.

        The instance ID variable may be specified as 'foo.bar', in which case
        the lookup will traverse into nested dicts, equivalent to:

        from_dict.get('foo', {}).get('bar', default)

        Multiple ID variables may be specified as 'foo.bar,foobar', so that
        it will first try to find 'bar' inside of 'foo', and if unable,
        will try to find 'foobar' as a fallback
        """
        instance_id = default
        if getattr(self, 'instance_id_var', None):
            for single_instance_id in self.instance_id_var.split(','):
                from_dict = variables
                for key in single_instance_id.split('.'):
                    if not hasattr(from_dict, 'get'):
                        instance_id = default
                        break
                    instance_id = from_dict.get(key, default)
                    from_dict = instance_id
                if instance_id:
                    break
        return smart_text(instance_id)
def _get_instance_id ( self , variables , default = '' ) : instance_id = default if getattr ( self , 'instance_id_var' , None ) : for single_instance_id in self . instance_id_var . split ( ',' ) : from_dict = variables for key in single_instance_id . split ( '.' ) : if not hasattr ( from_dict , 'get' ) : instance_id = default break instance_id = from_dict . get ( key , default ) from_dict = instance_id if instance_id : break return smart_text ( instance_id )