Project

General

Profile

Bug #29521

Remove '%s' literal from configuration database backup name

Added by Timur Bakeyev over 2 years ago. Updated over 2 years ago.

Status:
Done
Priority:
No priority
Assignee:
Timur Bakeyev
Category:
Middleware
Target version:
Seen in:
TrueNAS - TrueNAS 11.1-U2
Severity:
Low
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Related projects 1 project

Description

I've noticed the file named:

-rw-r----- 1 root wheel 946176 Mar 11 03:45 /var/db/system/configs-68c2a4ba2063471bbb20f5911ff16cf7/TrueNAS-11.1-U2-RC22 (211b3b969)/20180311%s.db

I guess it comes from this code in freenasUI/common/system.py:

def backup_database():
    from freenasUI.middleware.client import client

    with client as c:
        systemdataset = c.call('systemdataset.config')
    if not systemdataset or not systemdataset['path']:
        return

    # Legacy format
    files = glob.glob(f'{systemdataset["path"]}/*.db')
    reg = re.compile(r'.*(\d{4}-\d{2}-\d{2})-(\d+)\.db$')
    files = [y for y in files if reg.match(y)]
    for f in files:
        try:
            os.unlink(f)
        except OSError:
            pass

    today = datetime.now().strftime("%Y%m%d")

    newfile = os.path.join(
        systemdataset["path"],
        f'configs-{systemdataset["uuid"]}',
        get_sw_version(),
        f'{today}%s.db',
    )
...

Either %s here is redundant or something else has to be passed as a string literal.

Associated revisions

Revision b7bdcaab (diff)
Added by Timur I. Bakeyev over 2 years ago

Remove remained '%s' literal from the config DB backup name. Ticket: #29521

Revision f6ce5155 (diff)
Added by Timur I. Bakeyev over 2 years ago

Remove remained '%s' literal from the config DB backup name. Ticket: #29521 (cherry picked from commit b7bdcaabf4a4fd5133afc7e558581142e96e5e0c) Signed-off-by: Timur I. Bakeyev <timur@iXsystems.com>

History

#1 Updated by Timur Bakeyev over 2 years ago

  • Seen in changed from TrueNAS 11.1-U3 to TrueNAS 11.1-U2

#2 Updated by Dru Lavigne over 2 years ago

  • Category set to Middleware
  • Assignee set to William Grzybowski
  • Target version changed from N/A to TrueNAS 11.1-U3

William: please retarget if this is intrusive or non-critical for U3.

#3 Updated by William Grzybowski over 2 years ago

  • Target version changed from TrueNAS 11.1-U3 to TrueNAS-11.3

Thanks for the report, however they way I see it its fairly minor.

We are seeking to do middleware feature completeness work for 11.2 so setting it to 11.3.

Feel free to speak up if you think thats not ok.

#4 Updated by Timur Bakeyev over 2 years ago

That's fine with me. I'd fix it myself, but have no idea, what payload is expected in place of %s.

#5 Updated by William Grzybowski over 2 years ago

Timur Bakeyev wrote:

That's fine with me. I'd fix it myself, but have no idea, what payload is expected in place of %s.

No payload, its probably a wrong conversion using f-string. You can check the git history to be sure.

#6 Updated by Timur Bakeyev over 2 years ago

  • Status changed from Not Started to In Progress
  • Assignee changed from William Grzybowski to Timur Bakeyev

#7 Updated by Dru Lavigne over 2 years ago

  • Project changed from TrueNAS to FreeNAS
  • Category changed from Middleware to Middleware
  • Target version changed from TrueNAS-11.3 to 11.3
  • Migration Needed deleted (No)
  • Hide from ChangeLog deleted (No)
  • Support Department Priority deleted (0)

#8 Updated by Timur Bakeyev over 2 years ago

https://github.com/freenas/freenas/pull/960 for 11.1-stable

and committed to the master

#9 Updated by Dru Lavigne over 2 years ago

  • Needs Merging changed from Yes to No

#10 Updated by Dru Lavigne over 2 years ago

  • Subject changed from config.db backup gets incorrect name to Remove '%s' literal from configuration database backup name
  • Target version changed from 11.3 to 11.1-U4

#11 Avatar?id=14398&size=24x24 Updated by Kris Moore over 2 years ago

  • Status changed from In Progress to Done

#12 Updated by Dru Lavigne over 2 years ago

  • Needs Doc changed from Yes to No

#13 Updated by Nick Wolff over 2 years ago

  • Needs QA changed from Yes to No

Also available in: Atom PDF