On Mon, Oct 7, 2013 at 4:37 PM, Jose A. Lopes <[email protected]> wrote:
> Add confd request related constants to the Haskell to Python constant > generation. > > Signed-off-by: Jose A. Lopes <[email protected]> > --- > lib/constants.py | 8 ++++---- > src/Ganeti/HsConstants.hs | 14 ++++++++++++++ > 2 files changed, 18 insertions(+), 4 deletions(-) > > diff --git a/lib/constants.py b/lib/constants.py > index 5b11f75..30378c0 100644 > --- a/lib/constants.py > +++ b/lib/constants.py > @@ -2075,10 +2075,10 @@ CONFD_REQ_NODE_INSTANCES = 8 > # Confd request query fields. These are used to narrow down queries. > # These must be strings rather than integers, because json-encoding > # converts them to strings anyway, as they're used as dict-keys. > Maybe move this comment over to Haskell too, because here it's not clear that these constants are strings. On the Haskell side, however, it's a bit strange to have integers as strings without explanation. > -CONFD_REQQ_LINK = "0" > -CONFD_REQQ_IP = "1" > -CONFD_REQQ_IPLIST = "2" > -CONFD_REQQ_FIELDS = "3" > +CONFD_REQQ_LINK = _constants.CONFD_REQQ_LINK > +CONFD_REQQ_IP = _constants.CONFD_REQQ_IP > +CONFD_REQQ_IPLIST = _constants.CONFD_REQQ_IPLIST > +CONFD_REQQ_FIELDS = _constants.CONFD_REQQ_FIELDS > > CONFD_REQFIELD_NAME = "0" > CONFD_REQFIELD_IP = "1" > diff --git a/src/Ganeti/HsConstants.hs b/src/Ganeti/HsConstants.hs > index f043ff2..c483ff3 100644 > --- a/src/Ganeti/HsConstants.hs > +++ b/src/Ganeti/HsConstants.hs > @@ -1236,6 +1236,20 @@ confdErrorInternal = 2 > confdErrorUnknownEntry :: Int > confdErrorUnknownEntry = 1 > > +-- Confd request query fields > + > +confdReqqLink :: String > +confdReqqLink = ConstantUtils.confdReqqLink > + > +confdReqqIp :: String > +confdReqqIp = ConstantUtils.confdReqqIp > + > +confdReqqIplist :: String > +confdReqqIplist = ConstantUtils.confdReqqIplist > + > +confdReqqFields :: String > +confdReqqFields = ConstantUtils.confdReqqFields > + > -- | Each request is "salted" by the current timestamp. > -- > -- This constant decides how many seconds of skew to accept. > -- > 1.8.4 > > Rest LGTM, thanks. -- Thomas Thrainer | Software Engineer | [email protected] | Google Germany GmbH Dienerstr. 12 80331 München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores
