Days updates, fixes, and UI updates

This commit is contained in:
Gregory Kurtzer
2020-11-18 17:41:10 -08:00
parent ed7dbdaf32
commit 27441f77d3
22 changed files with 269 additions and 127 deletions

View File

@@ -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, &copy.Options{
//ReportWriter: os.Stdout,
ReportWriter: os.Stdout,
SourceCtx: p.sysCtx,
})
if err != nil {

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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() {