Jamie,

maybe you can help me with something. I'm trying to add the branding functionality of zones to the Solaris Zone module. For some reason my select box in the create_form.cgi keeps coming up as empty. Here's the code that I added below. I know readdir only returns single file / directory entries...so I'm not sure it I'm populating the @rv array correctly. The @rv array should look like this I'm assuming:

Since the directory entries under /usr/lib/brand are natvie, solaris8, solaris9 and the parent and current. I'm filtering out the parent and current which should leave me with the three remaining directories. So maybe you can point something out to me that I'm missing....

@rv = (native,solaris8,solaris9)

------------------create_form.cgi-------------------
print &ui_table_row($text{'create_brand'},
            &ui_select("brand",undef, &list_brands(), 0, 0, $value ? 1 : 0));
-----------------------------------------------------------

------------------forms-lib.pl-------------------------
local $brand = new Webmin::Select("brand",undef, &list_brands(), 0, 0, $value ? 1 : 0);
$section->add_input($text{'create_brand'}, $brand);
-----------------------------------------------------------

------------------zones-lib.pl------------------------
#list brands()
#returns a list of valid brands
sub list_brands
{
    local @rv;
    opendir(BRND, "/usr/lib/brand");
    foreach (readdir(BRND)) {
        if ($_ !~ /^\./){
            push(@rv, $_);
        }
    }
    close(BRND);
return @rv;
}
------------------------------------------------------------





On Sun, Jun 28, 2009 at 2:50 AM, Jamie Cameron <jcameron@webmin.com> wrote:
On 26/Jun/2009 06:22 Todd Kennedy <toddkenn@gmail.com> wrote ..
> Yeah I can add them to SVN....I guess once I have access I'll download the
> files I need to change from SVN then upload them once the changes have been
> made.

Actually, it might be simpler if you just download Webmin 1.480, make your
changes, then send me a patch.

> Also - There's a problem with the The breadcrumb link in Solaris Zones that
> is suppose to get you back to the previous page...but what happens is that
> when you click it it reruns the previous selection. So if you created a zone
> and then selected the return to zones list link at the bottom of the page it
> tries to create the zone again....I can hunt that down but might take me
> longer since I'm still trying to familiarize myself with that module.

That sounds like a bug. Let me know if you find the cause..

 - Jamie

> On Fri, Jun 26, 2009 at 3:51 AM, Jamie Cameron <jcameron@webmin.com> wrote:
>
> > On 25/Jun/2009 17:40 Todd Kennedy wrote ..
> >
> > Hey guys,
> >
> > I've been doing some work on the Solaris Zones module and have added a few
> > features and plan on making a few more. Like the ability to define a spare
> > root zone or whole root zone before the config, plus I plan adding the
> > template feature of zonecfg to the creation process as well. This would help
> > out allot since Solaris zones support branding of sol8 and sol9. Once I am
> > finished what is the best way to get patches to you Jamie? I've never
> > submitted anything before so I'm new to that part of it.
> >
> > Thanks
> >
> > Hi Todd,
> >
> > You can just email a patch to me directly at jcameron@webmin.com , and I
> > will apply it for inclusion in the next Webmin release. The zones mode
> > hasn't been touched for a while, and so is overdue for some new features.
> >
> > If you plan to do a lot of development, I can grant you commit access to
> > the Webmin SVN repository..
> >
> >  -  Jamie
> >
> >
> >
> > ------------------------------------------------------------------------------
> >
> > -
> > Forwarded by the Webmin development list at webmin-devel@webmin.com
> > To remove yourself from this list, go to
> > http://lists.sourceforge.net/lists/listinfo/webadmin-devel
> >
> >

------------------------------------------------------------------------------
-
Forwarded by the Webmin development list at webmin-devel@webmin.com
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel