Days updates, fixes, and UI updates
This commit is contained in:
@@ -134,7 +134,7 @@ func (p *puller) pull(ctx context.Context, uri, dst string) (err error) {
|
||||
|
||||
// copy to cache location
|
||||
_, err = copy.Image(ctx, policyCtx, cacheRef, srcRef, ©.Options{
|
||||
//ReportWriter: os.Stdout,
|
||||
ReportWriter: os.Stdout,
|
||||
SourceCtx: p.sysCtx,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -15,7 +15,7 @@ func templateFileInclude(path string) string {
|
||||
wwlog.Printf(wwlog.DEBUG, "Including file into template: %s\n", path)
|
||||
content, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "Template include: %s\n", err)
|
||||
wwlog.Printf(wwlog.WARN, "Could not include file into template: %s\n", err)
|
||||
}
|
||||
return strings.TrimSuffix(string(content), "\n")
|
||||
}
|
||||
@@ -28,7 +28,7 @@ func templateVnfsFileInclude(vnfsname string, filepath string) string {
|
||||
vnfsdir := config.VnfsChroot(v.NameClean())
|
||||
|
||||
if util.IsDir(vnfsdir) == false {
|
||||
wwlog.Printf(wwlog.WARN, "Could not include file from non-existent VNFS cache: %s:%s\n", vnfsname, filepath)
|
||||
wwlog.Printf(wwlog.WARN, "Template requesting file from non-imported VNFS: %s (%s)\n", vnfsname, filepath)
|
||||
return ""
|
||||
}
|
||||
wwlog.Printf(wwlog.DEBUG, "IncludeVnfs file from: %s/%s\n", vnfsdir, filepath)
|
||||
|
||||
@@ -71,7 +71,12 @@ func RuntimeBuild(nodeList []assets.NodeInfo, force bool) error {
|
||||
}
|
||||
|
||||
if util.IsDir(OverlayDir) == false {
|
||||
wwlog.Printf(wwlog.WARN, "Skipping non-existent overlay source: %s\n", OverlayDir)
|
||||
wwlog.Printf(wwlog.WARN, "%-35s: Skipped (unknown runtime overlay)\n", node.Fqdn)
|
||||
continue
|
||||
}
|
||||
|
||||
if util.IsDir(node.VnfsDir) == false {
|
||||
wwlog.Printf(wwlog.WARN, "%-35s: Skipped (VNFS not imported)\n", node.Fqdn)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -117,7 +122,7 @@ func RuntimeBuild(nodeList []assets.NodeInfo, force bool) error {
|
||||
|
||||
destFile := strings.TrimSuffix(location, ".ww")
|
||||
|
||||
tmpl, err := template.New(path.Base(location)).Funcs(template.FuncMap{"Include": templateFileInclude, "IncludeVnfs": templateVnfsFileInclude}).ParseGlob(path.Join(OverlayDir, destFile + ".ww*"))
|
||||
tmpl, err := template.New(path.Base(location)).Funcs(template.FuncMap{"Include": templateFileInclude, "IncludeFromVnfs": templateVnfsFileInclude}).ParseGlob(path.Join(OverlayDir, destFile + ".ww*"))
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "%s\n", err)
|
||||
return err
|
||||
|
||||
@@ -71,7 +71,12 @@ func SystemBuild(nodeList []assets.NodeInfo, force bool) error {
|
||||
}
|
||||
|
||||
if util.IsDir(OverlayDir) == false {
|
||||
wwlog.Printf(wwlog.WARN, "Skipping non-existent overlay source: %s\n", OverlayDir)
|
||||
wwlog.Printf(wwlog.WARN, "%-35s: Skipped (unknown system overlay)\n", node.Fqdn)
|
||||
continue
|
||||
}
|
||||
|
||||
if util.IsDir(node.VnfsDir) == false {
|
||||
wwlog.Printf(wwlog.WARN, "%-35s: Skipped (VNFS not imported)\n", node.Fqdn)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -117,7 +122,7 @@ func SystemBuild(nodeList []assets.NodeInfo, force bool) error {
|
||||
|
||||
destFile := strings.TrimSuffix(location, ".ww")
|
||||
|
||||
tmpl, err := template.New(path.Base(location)).Funcs(template.FuncMap{"Include": templateFileInclude, "IncludeVnfs": templateVnfsFileInclude}).ParseGlob(path.Join(OverlayDir, destFile + ".ww*"))
|
||||
tmpl, err := template.New(path.Base(location)).Funcs(template.FuncMap{"Include": templateFileInclude, "IncludeFromVnfs": templateVnfsFileInclude}).ParseGlob(path.Join(OverlayDir, destFile + ".ww*"))
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "%s\n", err)
|
||||
return err
|
||||
|
||||
@@ -84,6 +84,8 @@ func CopyFile(source string, dest string) error {
|
||||
return destFD.Close()
|
||||
}
|
||||
|
||||
//TODO: func CopyRecursive ...
|
||||
|
||||
|
||||
func IsDir(path string) (bool) {
|
||||
if stat, err := os.Stat(path); err == nil && stat.IsDir() {
|
||||
|
||||
Reference in New Issue
Block a user