racktables2netbox icon indicating copy to clipboard operation
racktables2netbox copied to clipboard

1054, "Unknown column 'description' in 'field list'

Open jbcreek opened this issue 2 years ago • 1 comments

ITJamie, I am using your newer version. I am receiving this error.

" pymysql.err.OperationalError: (1054, "Unknown column 'description' in 'field list'")"

Racktables version: 0.20.14 Netbox Version: 3.3.0

jbcreek avatar Aug 22 '22 16:08 jbcreek

Code changes since there is no 'description' field in racktables Tags table.

#def post_tag(self, tag, description): def post_tag(self, tag): url = self.base_url + "/extras/tags/" data = {} data["name"] = str(tag) data["slug"] = str(tag).lower().replace(" ", "_") #if not description is None: # data["description"] = description self.uploader2(data, url)

def get_tags(self): tags = []

    if not self.con:
        self.connect()
    with self.con:
        cur = self.con.cursor()
        #q = 'SELECT tag,description FROM TagTree where is_assignable = "yes";'
        q = 'SELECT tag FROM TagTree where is_assignable = "yes";'
        cur.execute(q)
        tags = cur.fetchall()
        if config["Log"]["DEBUG"]:
            msg = ("tags", str(tags))
            logger.debug(msg)
        cur.close()
        self.con = None

    for line in tags:
        #tag, description = line
        #netbox.post_tag(tag, description)
        tag = line
        netbox.post_tag(tag)

jbcreek avatar Aug 23 '22 12:08 jbcreek