Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

NOTE: The sense of the "#ifdef/#ifndef" is backwards from what we really want,

but this will be dealt with in the next a later section below.

. . .

#ifndef USING_PYTHON2

from logginginterface import *

#else /* USING_PYTHON2 */

from .logginginterface import *

#endif /* USING_PYTHON2 */

. . .

#ifndef USING_PYTHON2

import urllib

#else /* USING_PYTHON2 */

import urllib.request, urllib.parse, urllib.error

#endif /* USING_PYTHON2 */

. . .

#ifndef USING_PYTHON2

  return urllib.quote(str(s), '')

#else /* USING_PYTHON2 */

  return urllib.parse.quote(str(s), '')

#endif /* USING_PYTHON2 */

. . .

#ifndef USING_PYTHON2

  os.umask(077)

#else /* USING_PYTHON2 */

  os.umask(0o77)

#endif /* USING_PYTHON2 */

. . .

#ifndef USING_PYTHON2

  if openstack.has_key('custom_configuration'):

#else /* USING_PYTHON2 */

  if 'custom_configuration' in openstack:

#endif /* USING_PYTHON2 */

. . .

#ifndef USING_PYTHON2

  print >>fp, binascii.hexlify(b).decode('utf-8')

#else /* USING_PYTHON2 */

  print(binascii.hexlify(b).decode('utf-8'), file=fp)

#endif /* USING_PYTHON2 */

. . .

#ifndef USING_PYTHON2

  debug("ctx node has the following Properties: {}".format(i.properties.keys()))

#else /* USING_PYTHON2 */

  debug("ctx node has the following Properties: {}".format(list(i.properties.keys())))

#endif /* USING_PYTHON2 */

. . .

#ifndef USING_PYTHON2

  for k, nv in want.items():

#else /* USING_PYTHON2 */

  for k, nv in list(want.items()):

#endif /* USING_PYTHON2 */

. . .

...