The "sles" distribution string in libguestfs represents both SLES and SLED, so map the osinfo descriptions of "sled" distributions as "sles". --- src/osinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osinfo.c b/src/osinfo.c index 907580e..7fdaf1c 100644 --- a/src/osinfo.c +++ b/src/osinfo.c @@ -625,7 +625,7 @@ parse_distro (guestfs_h *g, xmlNodePtr node, struct osinfo *osinfo) osinfo->distro = OS_DISTRO_OPENSUSE; else if (STREQ (content, "rhel")) osinfo->distro = OS_DISTRO_RHEL; - else if (STREQ (content, "sles")) + else if (STREQ (content, "sled") || STREQ (content, "sles")) osinfo->distro = OS_DISTRO_SLES; else if (STREQ (content, "ubuntu")) osinfo->distro = OS_DISTRO_UBUNTU; -- 2.7.4
Richard W.M. Jones
2016-Jul-26 10:17 UTC
Re: [Libguestfs] [PATCH] osinfo: map "sled" as "sles"
On Tue, Jul 26, 2016 at 10:45:33AM +0200, Pino Toscano wrote:> The "sles" distribution string in libguestfs represents both SLES and > SLED, so map the osinfo descriptions of "sled" distributions as "sles". > --- > src/osinfo.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/osinfo.c b/src/osinfo.c > index 907580e..7fdaf1c 100644 > --- a/src/osinfo.c > +++ b/src/osinfo.c > @@ -625,7 +625,7 @@ parse_distro (guestfs_h *g, xmlNodePtr node, struct osinfo *osinfo) > osinfo->distro = OS_DISTRO_OPENSUSE; > else if (STREQ (content, "rhel")) > osinfo->distro = OS_DISTRO_RHEL; > - else if (STREQ (content, "sles")) > + else if (STREQ (content, "sled") || STREQ (content, "sles")) > osinfo->distro = OS_DISTRO_SLES; > else if (STREQ (content, "ubuntu")) > osinfo->distro = OS_DISTRO_UBUNTU;ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Reasonably Related Threads
- [PATCH v4 2/9] lib: extract osinfo DB traversing API
- [PATCH v3 05/10] lib: extract osinfo DB traversing API
- [PATCH v7 2/9] lib: extract osinfo DB traversing API
- [PATCH v6 02/10] lib: extract osinfo DB traversing API
- [PATCH v2 3/7] mllib: expose libosinfo DB reading functions in mllib