add mhvtl detect vendor
This commit is contained in:
@@ -275,10 +275,10 @@ func (m *MHVTLMonitor) syncLibrary(ctx context.Context, libInfo LibraryInfo) err
|
||||
_, err = m.service.db.ExecContext(ctx, `
|
||||
INSERT INTO virtual_tape_libraries (
|
||||
name, description, mhvtl_library_id, backing_store_path,
|
||||
slot_count, drive_count, is_active
|
||||
) VALUES ($1, $2, $3, $4, $5, $6, $7)
|
||||
vendor, slot_count, drive_count, is_active
|
||||
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
|
||||
`, libraryName, fmt.Sprintf("MHVTL Library %d (%s)", libInfo.LibraryID, libInfo.Product),
|
||||
libInfo.LibraryID, backingStorePath, slotCount, driveCount, true)
|
||||
libInfo.LibraryID, backingStorePath, libInfo.Vendor, slotCount, driveCount, true)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to insert library: %w", err)
|
||||
}
|
||||
@@ -288,10 +288,10 @@ func (m *MHVTLMonitor) syncLibrary(ctx context.Context, libInfo LibraryInfo) err
|
||||
_, err = m.service.db.ExecContext(ctx, `
|
||||
UPDATE virtual_tape_libraries SET
|
||||
name = $1, description = $2, backing_store_path = $3,
|
||||
is_active = $4, updated_at = NOW()
|
||||
WHERE id = $5
|
||||
vendor = $4, is_active = $5, updated_at = NOW()
|
||||
WHERE id = $6
|
||||
`, libraryName, fmt.Sprintf("MHVTL Library %d (%s)", libInfo.LibraryID, libInfo.Product),
|
||||
libInfo.HomeDirectory, true, existingID)
|
||||
libInfo.HomeDirectory, libInfo.Vendor, true, existingID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to update library: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user