Setter method for if_role, mapped from YANG variable /brocade_xstp_ext_rpc/get_stp_mst_detail/output/cist/port/if_role (stp-port-role)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_if_role is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_if_role() directly.

    YANG Description: Interface role

def _set_if_role(self, v, load=False):
    """
    Setter method for if_role, mapped from YANG variable /brocade_xstp_ext_rpc/get_stp_mst_detail/output/cist/port/if_role (stp-port-role)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_if_role is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_if_role() directly.

    YANG Description: Interface role
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'backup': {'value': 5}, u'alternate': {'value': 4}, u'designated': {'value': 2}, u'disabled': {'value': 6}, u'master': {'value': 7}, u'error': {'value': 1}, u'root': {'value': 3}},), is_leaf=True, yang_name="if-role", rest_name="if-role", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-xstp-ext', defining_module='brocade-xstp-ext', yang_type='stp-port-role', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """if_role must be of a type compatible with stp-port-role""",
          'defined-type': "brocade-xstp-ext:stp-port-role",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'backup': {'value': 5}, u'alternate': {'value': 4}, u'designated': {'value': 2}, u'disabled': {'value': 6}, u'master': {'value': 7}, u'error': {'value': 1}, u'root': {'value': 3}},), is_leaf=True, yang_name="if-role", rest_name="if-role", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-xstp-ext', defining_module='brocade-xstp-ext', yang_type='stp-port-role', is_config=True)""",
        })

    self.__if_role = t
    if hasattr(self, '_set'):
      self._set()