*given a file to a yaml file, add yaml file content to database*

        **Key Arguments:**
            - ``filepath`` -- the path to the yaml file
            - ``deleteFile`` -- delete the yaml file when its content has been added to the database. Default *False*

        **Return:**
            - None

        **Usage:**

            To parse and import the contents of a single yaml file into the database, use the following:

            .. code-block:: python 

                from fundamentals.mysql import yaml_to_database
                # PARSE YAML FILE CONTENTS AND ADD TO DATABASE
                yaml2db = yaml_to_database(
                    log=log,
                    settings=settings,
                    dbConn=dbConn
                ) 
                yaml2db.add_yaml_file_content_to_database(
                    filepath=${1:"/path/to/file.yaml"},
                    deleteFile=True
                )

def add_yaml_file_content_to_database(
        self,
        filepath,
        deleteFile=False
    ):
        """*given a file to a yaml file, add yaml file content to database*

        **Key Arguments:**
            - ``filepath`` -- the path to the yaml file
            - ``deleteFile`` -- delete the yaml file when its content has been added to the database. Default *False*

        **Return:**
            - None

        **Usage:**

            To parse and import the contents of a single yaml file into the database, use the following:

            .. code-block:: python 

                from fundamentals.mysql import yaml_to_database
                # PARSE YAML FILE CONTENTS AND ADD TO DATABASE
                yaml2db = yaml_to_database(
                    log=log,
                    settings=settings,
                    dbConn=dbConn
                ) 
                yaml2db.add_yaml_file_content_to_database(
                    filepath=${1:"/path/to/file.yaml"},
                    deleteFile=True
                )
        """
        self.log.debug(
            'completed the ````add_yaml_file_content_to_database`` method')

        import codecs
        try:
            self.log.debug("attempting to open the file %s" % (filepath,))
            readFile = codecs.open(filepath, encoding='utf-8', mode='r')
            thisData = readFile.read()
            readFile.close()
        except IOError, e:
            message = 'could not open the file %s' % (filepath,)
            self.log.critical(message)
            raise IOError(message)
        readFile.close()

        matchObject = re.finditer(
            r'(^|\n)(?P<key>[^\:]*)\:\s(?P<value>.*?)(\n|$)',
            thisData,
            flags=re.M | re.S  # re.S
        )

        yamlContent = {}
        for match in matchObject:
            if match.group("value")[0] == '"' and match.group("value")[-1] == '"':
                v = match.group("value")[1:-1]
            elif match.group("value")[0] == "'" and match.group("value")[-1] == "'":
                v = match.group("value")[1:-1]
            else:
                v = match.group("value")
            yamlContent[match.group("key")] = v

        if "table" not in yamlContent:
            self.log.warning(
                'A table value is need in the yaml content to indicate which database table to add the content to: %(filepath)s' % locals())
            return None

        # NOTE THERE MAY BE MORE THAN ONE DATABASE TABLE
        dbTablesTmp = yamlContent["table"].split(",")
        del yamlContent["table"]
        dbTables = []
        dbTables[:] = [d.strip() for d in dbTablesTmp]

        # UNSHORTEN URL
        try:
            r = requests.head(yamlContent["url"], allow_redirects=True)
            yamlContent["url"] = r.url
        except:
            pass

        yamlContent["original_yaml_path"] = filepath

        if "url" in yamlContent:
            uniqueKeyList = ["url"]
        else:
            uniqueKeyList = []

        for t in dbTables:
            convert_dictionary_to_mysql_table(
                dbConn=self.dbConn,
                log=self.log,
                dictionary=yamlContent,
                dbTableName=t,
                uniqueKeyList=uniqueKeyList,
                dateModified=True,
                returnInsertOnly=False,
                replace=True
            )
        if deleteFile:
            os.remove(filepath)

        self.log.debug(
            'completed the ``add_yaml_file_content_to_database`` method')
        return None