#coding:utf-8

import os
import sys
import sunhpc
class Command(sunhpc.commands.sync.command):
    """
    For each system configuration file controlled by Sunhpc, first
    rebuild the configuration file by extracting data from the
    database, then restart the relevant services.

    <example cmd='sync config'>
    Rebuild all configuration files and restart relevant services.
    </example>
    """
    def run(self, params, args):
        #
        # don't call insert-ethers if insert-ethers is already
        # running. this can occur when one replaces a node
        # (insert-ethers calls 'sunhpc remove host' which calls
        # sunhpc sync config).
        #
        if not os.path.exists('/var/lock/insert-ethers'):
            #
            # run the plugins 
            #
            self.runPlugins()

RollName = "base"
