'Create a copy of the profile file into copy_profile_name. The directory
of the profile is kept unless specified.'

def copy(self, copy_profile_name):

    new_profile_path_name = copy_profile_name
    if (os.path.sep not in copy_profile_name):
        dir = os.path.dirname(self.profile_file_name)
        new_profile_path_name = os.path.join(dir, copy_profile_name)
    if (not new_profile_path_name.endswith(self.EXTENSION)):
        new_profile_path_name += self.EXTENSION
    try:
        shutil.copyfile(self.profile_file_name, new_profile_path_name)
    except Exception as e:
        msg = 'An    exception    occurred    while    copying    the    profile.    Exception:'
        msg += ('    "%s".' % e)
        raise BaseFrameworkException((msg % e))
    else:
        new_profile = profile(new_profile_path_name)
        new_profile.set_name(copy_profile_name)
        new_profile.save(new_profile_path_name)
        return True
