Common code for conditionally removing masks before making changes to a
    service's state.

def _check_unmask(name, unmask, unmask_runtime, root=None):
    '''
    Common code for conditionally removing masks before making changes to a
    service's state.
    '''
    if unmask:
        unmask_(name, runtime=False, root=root)
    if unmask_runtime:
        unmask_(name, runtime=True, root=root)