def _create_data_files_directory(symlink=False):
        """Install data_files in the /etc directory."""
        current_directory = os.path.abspath(os.path.dirname(__file__))

        etc_kytos = os.path.join(BASE_ENV, ETC_KYTOS)

        if not os.path.exists(etc_kytos):
            os.makedirs(etc_kytos)

        src = os.path.join(current_directory, KYTOS_SKEL_PATH)
        dst = os.path.join(BASE_ENV, KYTOS_SKEL_PATH)

        if os.path.exists(dst):
            if not os.listdir(dst):
                # Path already exists but it's empty, so we'll populate it
                # We remove it first to avoid an exception from copytree
                os.rmdir(dst)
                shutil.copytree(src, dst)
        else:
            # It doesn't exist yet, so we should symlink or copy contents
            if symlink:
                os.symlink(src, dst)
            else:
                shutil.copytree(src, dst)
def _create_data_files_directory ( symlink = False ) : current_directory = os . path . abspath ( os . path . dirname ( __file__ ) ) etc_kytos = os . path . join ( BASE_ENV , ETC_KYTOS ) if not os . path . exists ( etc_kytos ) : os . makedirs ( etc_kytos ) src = os . path . join ( current_directory , KYTOS_SKEL_PATH ) dst = os . path . join ( BASE_ENV , KYTOS_SKEL_PATH ) if os . path . exists ( dst ) : if not os . listdir ( dst ) : os . rmdir ( dst ) shutil . copytree ( src , dst ) else : if symlink : os . symlink ( src , dst ) else : shutil . copytree ( src , dst )
Install data_files in the /etc directory.