Managing configs to use scripts on different computers
You have a value (hostname in this case) that you want to use to select among
various data choices (config modules in this case). When you have situations
like this, use a data structure. Sensible
data is always simpler than logic. For example, see Rule 5 from Rob
Pike.
An illustration based on your code:
import socket
import DConfig
import AConfig
import MConfig

configs = {
    'host-D': DConfig,
    'host-A': AConfig,
    'host-M': MConfig,
}

hostname = socket.gethostname()
Conf = configs.get(hostname, MConfig)