Allow use of NFD and NLSR PPA with Mini-NDN.

Refs: #3992

Change-Id: I329d0303bb4e03ec2296dfb7f7aa00cac3dadfbd
diff --git a/ndn/util.py b/ndn/util.py
index 7ccf5d0..0ed570d 100644
--- a/ndn/util.py
+++ b/ndn/util.py
@@ -24,6 +24,7 @@
 from subprocess import call
 from mininet.cli import CLI
 import sys
+from os.path import isfile
 
 sshbase = [ 'ssh', '-q', '-t', '-i/home/mininet/.ssh/id_rsa' ]
 scpbase = [ 'scp', '-i', '/home/mininet/.ssh/id_rsa' ]
@@ -40,6 +41,16 @@
     rcmd = scpbase + tmp
     call(rcmd, stdout=devnull, stderr=devnull)
 
+def copyExistentFile(node, fileList, destination):
+    for file in fileList:
+        if isfile(file):
+            node.cmd("cp {} {}".format(file, destination))
+            break
+    if not isfile(destination):
+        fileName = destination.split("/")[-1]
+        raise IOError("{} not found in expected directory.".format(fileName))
+
+
 class MiniNDNCLI(CLI):
     prompt = 'mini-ndn> '
     def __init__(self, mininet, stdin=sys.stdin, script=None):