Douglas Schilling Landgraf has posted comments on this change.

Change subject: backend: upgrade - process symbolic link files
......................................................................


Patch Set 1:

(3 comments)

http://gerrit.ovirt.org/#/c/27395/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetoVirtISOsQuery.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetoVirtISOsQuery.java:

Line 32
Line 33
Line 34
Line 35
Line 36
> replace to set as well so you won't get duplicates.
We can replace but it's not related to this bugzilla. Another patch can achieve 
this improvement. The duplicate could only occur if we use getCanonicalPath() 
since we get the file twice in the loop because of symbolic link.


Line 58
Line 59
Line 60
Line 61
Line 62
> won't it better to have file.getCanonicalPath()
import java.io.File;
public class Main {
    public static void main(String [] args) {

    File f = new File("/usr/share/rhev-hypervisor/rhevh-latest-6.iso");
    
System.out.println(f.getAbsolutePath().substring(f.getAbsolutePath().lastIndexOf("/")+1));
    }
}


returns "rhevh-latest-6.iso"


http://gerrit.ovirt.org/#/c/27395/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpgradeOvirtNodeInternalCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpgradeOvirtNodeInternalCommand.java:

Line 56:         boolean ret = false;
Line 57: 
Line 58:         log.debugFormat("Check if ISO compatible: {0}", iso);
Line 59: 
Line 60:         String FileName = iso.getName();
> same.... iso.getCanonicalPath()
Replied in previous comment
Line 61:         Path path = Paths.get(iso.toString());
Line 62:         try {
Line 63:             if (Files.isSymbolicLink(path)) {
Line 64:                 FileName = 
Files.readSymbolicLink(path).getFileName().toString();


-- 
To view, visit http://gerrit.ovirt.org/27395
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If4084095c40848dc5573d434c1c7ca497883b280
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsl...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsl...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to