1675def applyConfigurableUsers_old():
1676 """
1677 Obsolete (buggy) implementation of applyConfigurableUsers(), kept to provide
1678 backward compatibility for configurations that where relying (implicitly) on
1679 bug #103803, or on a specific (non guaranteed) order of execution.
1680
1681 @see applyConfigurableUsers()
1682 """
1683
1684 global _appliedConfigurableUsers_, postConfigActions
1685 if _appliedConfigurableUsers_:
1686 return
1687 _appliedConfigurableUsers_ = True
1688
1689 debugApplyOrder = "GAUDI_DUBUG_CONF_USER" in os.environ
1690 confUsers = [
1691 c
1692 for c in Configurable.allConfigurables.values()
1693 if hasattr(c, "__apply_configuration__")
1694 ]
1695 applied = True
1696 while applied and confUsers:
1697 newConfUsers = []
1698 applied = False
1699 for c in confUsers:
1700 if hasattr(c, "__users__") and c.__users__:
1701 newConfUsers.append(c)
1702 else:
1703 applied = True
1704
1705
1706 enabled = (not hasattr(c, "_enabled")) or c._enabled
1707 if enabled:
1708 log.info("applying configuration of %s", c.name())
1709 if debugApplyOrder:
1710 sys.stderr.write("applying %r" % c)
1711 c.__apply_configuration__()
1712 log.info(c)
1713 else:
1714 log.info("skipping configuration of %s", c.name())
1715 if hasattr(c, "__detach_used__"):
1716
1717 c.__detach_used__()
1718 confUsers = newConfUsers
1719 if confUsers:
1720
1721 raise Error(
1722 "Detected loop in the ConfigurableUser "
1723 " dependencies: %r" % [c.name() for c in confUsers]
1724 )
1725
1726 known = set()
1727 unknown = set(Configurable.allConfigurables)
1728 while unknown:
1729 for k in unknown:
1730 if not known:
1731 log.debug("new configurable created automatically: %s", k)
1732
1733 Configurable.allConfigurables[k].properties()
1734 known.add(k)
1735 unknown -= known
1736
1737 for action in postConfigActions:
1738 action()
1739
1740