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