[sanlock] 13/14: python: Unify indentation
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
nsoffer pushed a commit to branch master
in repository sanlock.
commit 59367ebaea8d37bc34173e3586d898e0d969bb0f
Author: Nir Soffer <nsoffer(a)redhat.com>
AuthorDate: Fri Jun 14 23:34:06 2019 +0300
python: Unify indentation
Some tabs sneaked into the module before we added the vim modeline. Some
Py_BuildValue calls used too much indentation.
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
python/sanlock.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/python/sanlock.c b/python/sanlock.c
index 556627c..12e2195 100644
--- a/python/sanlock.c
+++ b/python/sanlock.c
@@ -216,13 +216,13 @@ add_sector_flag(int sector, uint32_t *flags)
switch (sector) {
case SECTOR_SIZE_512:
*flags |= SANLK_LSF_SECTOR512;
- break;
+ break;
case SECTOR_SIZE_4K:
*flags |= SANLK_LSF_SECTOR4K;
- break;
+ break;
default:
- PyErr_Format(PyExc_ValueError, "Invalid sector value: %d", sector);
- return -1;
+ PyErr_Format(PyExc_ValueError, "Invalid sector value: %d", sector);
+ return -1;
}
return 0;
}
@@ -240,19 +240,19 @@ add_align_flag(long align, uint32_t *flags)
switch (align) {
case ALIGNMENT_1M:
*flags |= SANLK_RES_ALIGN1M;
- break;
+ break;
case ALIGNMENT_2M:
*flags |= SANLK_RES_ALIGN2M;
- break;
+ break;
case ALIGNMENT_4M:
*flags |= SANLK_RES_ALIGN4M;
- break;
+ break;
case ALIGNMENT_8M:
*flags |= SANLK_RES_ALIGN8M;
- break;
+ break;
default:
- PyErr_Format(PyExc_ValueError, "Invalid align value: %ld", align);
- return -1;
+ PyErr_Format(PyExc_ValueError, "Invalid align value: %ld", align);
+ return -1;
}
return 0;
}
@@ -613,12 +613,12 @@ py_read_lockspace(PyObject *self __unused, PyObject *args, PyObject *keywds)
/* fill the information dictionary */
ls_info = Py_BuildValue(
#if PY_MAJOR_VERSION == 2
- "{s:s,s:I}",
+ "{s:s,s:I}",
#else
- "{s:y,s:I}",
+ "{s:y,s:I}",
#endif
- "lockspace", ls.name,
- "iotimeout", io_timeout);
+ "lockspace", ls.name,
+ "iotimeout", io_timeout);
if (ls_info == NULL)
goto finally;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months
[sanlock] 12/14: python: Streamline py_get_lockspaces()
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
nsoffer pushed a commit to branch master
in repository sanlock.
commit e5d3bb565ec68197b5aa5f5eee77f72803e75e6b
Author: Nir Soffer <nsoffer(a)redhat.com>
AuthorDate: Fri Jun 14 23:23:03 2019 +0300
python: Streamline py_get_lockspaces()
py_get_lockspaces() was using the same error prone error cleanup as
hosts_to_list(), mixed with code to call sanlock, to make the code
harder to follow.
Extract lockspaces_to_list() helper, implemented exactly like
hosts_to_list. This simplify py_get_lockspaces() and allow using the
simpler finally pattern we used in other functions.
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
python/sanlock.c | 76 +++++++++++++++++++++++++++++---------------------------
1 file changed, 40 insertions(+), 36 deletions(-)
diff --git a/python/sanlock.c b/python/sanlock.c
index 4f80379..556627c 100644
--- a/python/sanlock.c
+++ b/python/sanlock.c
@@ -963,6 +963,42 @@ finally:
Py_RETURN_NONE;
}
+static PyObject *
+lockspaces_to_list(struct sanlk_lockspace *lss, int lss_count)
+{
+ PyObject *ls_list = PyList_New(lss_count);
+ if (ls_list == NULL)
+ goto exit_fail;
+
+ for (int i = 0; i < lss_count; i++) {
+ PyObject *ls_entry = Py_BuildValue(
+#if PY_MAJOR_VERSION == 2
+ "{s:s,s:K,s:s,s:K,s:I}",
+#else
+ "{s:y,s:K,s:s,s:K,s:I}",
+#endif
+ "lockspace", lss[i].name,
+ "host_id", lss[i].host_id,
+ "path", lss[i].host_id_disk.path,
+ "offset", lss[i].host_id_disk.offset,
+ "flags", lss[i].flags);
+ if (ls_entry == NULL)
+ goto exit_fail;
+
+ /* Steals reference to ls_entry. */
+ if (PyList_SetItem(ls_list, i, ls_entry) != 0) {
+ Py_DECREF(ls_entry);
+ goto exit_fail;
+ }
+ }
+
+ return ls_list;
+
+exit_fail:
+ Py_XDECREF(ls_list);
+ return NULL;
+}
+
/* get_lockspaces */
PyDoc_STRVAR(pydoc_get_lockspaces, "\
get_lockspaces() -> list\n\
@@ -977,7 +1013,7 @@ py_get_lockspaces(PyObject *self __unused, PyObject *args, PyObject *keywds)
{
int rv, lss_count;
struct sanlk_lockspace *lss = NULL;
- PyObject *ls_list = NULL, *ls_entry = NULL;
+ PyObject *ls_list = NULL;
/* get all the lockspaces (gil disabled) */
Py_BEGIN_ALLOW_THREADS
@@ -986,46 +1022,14 @@ py_get_lockspaces(PyObject *self __unused, PyObject *args, PyObject *keywds)
if (rv < 0) {
set_sanlock_error(rv, "Sanlock get lockspaces failure");
- goto exit_fail;
+ goto finally;
}
- /* prepare the dictionary holding the information */
- if ((ls_list = PyList_New(0)) == NULL)
- goto exit_fail;
+ ls_list = lockspaces_to_list(lss, lss_count);
- for (int i = 0; i < lss_count; i++) {
-
- /* fill the dictionary information */
- ls_entry = Py_BuildValue(
-#if PY_MAJOR_VERSION == 2
- "{s:s,s:K,s:s,s:K,s:I}",
-#else
- "{s:y,s:K,s:s,s:K,s:I}",
-#endif
- "lockspace", lss[i].name,
- "host_id", lss[i].host_id,
- "path", lss[i].host_id_disk.path,
- "offset", lss[i].host_id_disk.offset,
- "flags", lss[i].flags);
- if (ls_entry == NULL)
- goto exit_fail;
-
- if (PyList_Append(ls_list, ls_entry) != 0)
- goto exit_fail;
-
- Py_DECREF(ls_entry);
- }
-
- /* success */
+finally:
free(lss);
return ls_list;
-
- /* failure */
-exit_fail:
- free(lss);
- Py_XDECREF(ls_entry);
- Py_XDECREF(ls_list);
- return NULL;
}
/* get_hosts */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months
[sanlock] 11/14: python: Streamline hosts_to_list
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
nsoffer pushed a commit to branch master
in repository sanlock.
commit 80c7effc57e492fed86c50040a6ad032346283ef
Author: Nir Soffer <nsoffer(a)redhat.com>
AuthorDate: Fri Jun 14 23:00:18 2019 +0300
python: Streamline hosts_to_list
This function used error prone style, using local loop variable in the
scope of the function, making cleanup more risky.
Move ls_entry info the loop scope, and use PyList_SetItem(), stealing
the reference to ls_entry, so we need to decrease the reference count
only on errors.
To use PyList_SetItem() we need to allocate the entire list upfront,
which is good idea anyway.
While refactoring, remove some useless and wrong comments.
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
python/sanlock.c | 31 +++++++++++++------------------
1 file changed, 13 insertions(+), 18 deletions(-)
diff --git a/python/sanlock.c b/python/sanlock.c
index 4c3e0a0..4f80379 100644
--- a/python/sanlock.c
+++ b/python/sanlock.c
@@ -271,36 +271,31 @@ set_error(PyObject* exception, const char* format, PyObject* obj)
static PyObject *
hosts_to_list(struct sanlk_host *hss, int hss_count)
{
- PyObject *ls_list = NULL, *ls_entry = NULL;
-
- /* prepare the dictionary holding the information */
- if ((ls_list = PyList_New(0)) == NULL)
+ PyObject *ls_list = PyList_New(hss_count);
+ if (ls_list == NULL)
goto exit_fail;
for (int i = 0; i < hss_count; i++) {
-
- /* fill the dictionary information */
- ls_entry = Py_BuildValue(
- "{s:K,s:K,s:K,s:I,s:I}",
- "host_id", hss[i].host_id,
- "generation", hss[i].generation,
- "timestamp", hss[i].timestamp,
- "io_timeout", hss[i].io_timeout,
- "flags", hss[i].flags);
+ PyObject *ls_entry = Py_BuildValue(
+ "{s:K,s:K,s:K,s:I,s:I}",
+ "host_id", hss[i].host_id,
+ "generation", hss[i].generation,
+ "timestamp", hss[i].timestamp,
+ "io_timeout", hss[i].io_timeout,
+ "flags", hss[i].flags);
if (ls_entry == NULL)
goto exit_fail;
- if (PyList_Append(ls_list, ls_entry) != 0)
+ /* Steals reference to ls_entry. */
+ if (PyList_SetItem(ls_list, i, ls_entry) != 0) {
+ Py_DECREF(ls_entry);
goto exit_fail;
-
- Py_DECREF(ls_entry);
+ }
}
return ls_list;
- /* failure */
exit_fail:
- Py_XDECREF(ls_entry);
Py_XDECREF(ls_list);
return NULL;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months
[sanlock] 10/14: python: Remove unneeded check for null
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
nsoffer pushed a commit to branch master
in repository sanlock.
commit 806d671c54a003b3908609ac768730d0f57d6ed0
Author: Nir Soffer <nsoffer(a)redhat.com>
AuthorDate: Fri Jun 14 22:01:30 2019 +0300
python: Remove unneeded check for null
When calling free() we don't need to check if a point is NULL.
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
python/sanlock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/sanlock.c b/python/sanlock.c
index ed9de0f..4c3e0a0 100644
--- a/python/sanlock.c
+++ b/python/sanlock.c
@@ -1027,7 +1027,7 @@ py_get_lockspaces(PyObject *self __unused, PyObject *args, PyObject *keywds)
/* failure */
exit_fail:
- if (lss) free(lss);
+ free(lss);
Py_XDECREF(ls_entry);
Py_XDECREF(ls_list);
return NULL;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months
[sanlock] 09/14: python: Limit the scope of for loop counter
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
nsoffer pushed a commit to branch master
in repository sanlock.
commit ed46eba762f0b7578409f2e16bd58fa740c0a536
Author: Nir Soffer <nsoffer(a)redhat.com>
AuthorDate: Fri Jun 14 21:53:58 2019 +0300
python: Limit the scope of for loop counter
Replace:
int i;
for (i = 0; ...)
With:
for (int i = 0; ...)
This removes unneeded variable from the function, and limit the scope of
the counter to the loop.
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
python/sanlock.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/python/sanlock.c b/python/sanlock.c
index 2216322..ed9de0f 100644
--- a/python/sanlock.c
+++ b/python/sanlock.c
@@ -175,7 +175,7 @@ finally:
static int
parse_disks(PyObject *obj, struct sanlk_resource **res_ret)
{
- int i, num_disks, res_len;
+ int num_disks, res_len;
struct sanlk_resource *res;
num_disks = PyList_Size(obj);
@@ -192,7 +192,7 @@ parse_disks(PyObject *obj, struct sanlk_resource **res_ret)
memset(res, 0, res_len);
res->num_disks = num_disks;
- for (i = 0; i < num_disks; i++) {
+ for (int i = 0; i < num_disks; i++) {
PyObject *disk = PyList_GetItem(obj,i);
if (!parse_single_disk(disk, &(res->disks[i]))) {
@@ -271,14 +271,13 @@ set_error(PyObject* exception, const char* format, PyObject* obj)
static PyObject *
hosts_to_list(struct sanlk_host *hss, int hss_count)
{
- int i;
PyObject *ls_list = NULL, *ls_entry = NULL;
/* prepare the dictionary holding the information */
if ((ls_list = PyList_New(0)) == NULL)
goto exit_fail;
- for (i = 0; i < hss_count; i++) {
+ for (int i = 0; i < hss_count; i++) {
/* fill the dictionary information */
ls_entry = Py_BuildValue(
@@ -981,7 +980,7 @@ released.\n");
static PyObject *
py_get_lockspaces(PyObject *self __unused, PyObject *args, PyObject *keywds)
{
- int rv, i, lss_count;
+ int rv, lss_count;
struct sanlk_lockspace *lss = NULL;
PyObject *ls_list = NULL, *ls_entry = NULL;
@@ -999,7 +998,7 @@ py_get_lockspaces(PyObject *self __unused, PyObject *args, PyObject *keywds)
if ((ls_list = PyList_New(0)) == NULL)
goto exit_fail;
- for (i = 0; i < lss_count; i++) {
+ for (int i = 0; i < lss_count; i++) {
/* fill the dictionary information */
ls_entry = Py_BuildValue(
@@ -1354,8 +1353,8 @@ finally:
static int
parse_killpath_item(PyObject *item, char *kpargs, size_t *kplen)
{
- int rv = 0, i;
- size_t arg_len;
+ int rv = 0;
+ size_t arg_len = 0;
PyObject *path = NULL;
const char *p = NULL;
@@ -1367,7 +1366,7 @@ parse_killpath_item(PyObject *item, char *kpargs, size_t *kplen)
goto finally;
}
/* computing the argument length considering the escape chars */
- for (i = 0, arg_len = 0; p[i]; i++, arg_len++) {
+ for (int i = 0; p[i]; i++, arg_len++) {
if (p[i] == ' ' || p[i] == '\\') arg_len++;
}
@@ -1407,8 +1406,8 @@ The arguments must be in the format: [\"arg1\", \"arg2\", ...]");
static PyObject *
py_killpath(PyObject *self __unused, PyObject *args, PyObject *keywds)
{
- int rv = -1, i, num_args, sanlockfd = -1;
- size_t kplen;
+ int rv = -1, num_args, sanlockfd = -1;
+ size_t kplen = 0;
char kpargs[SANLK_HELPER_ARGS_LEN];
PyObject *path = NULL;
PyObject *argslist;
@@ -1431,7 +1430,7 @@ py_killpath(PyObject *self __unused, PyObject *args, PyObject *keywds)
memset(kpargs, 0, SANLK_HELPER_ARGS_LEN);
/* creating the arguments string from a python list */
- for (i = 0, kplen = 0; i < num_args; i++) {
+ for (int i = 0; i < num_args; i++) {
PyObject *item = PyList_GetItem(argslist, i);
if (!parse_killpath_item(item, kpargs, &kplen)) {
goto finally;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months
[sanlock] 08/14: python: Use C99 standard
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
nsoffer pushed a commit to branch master
in repository sanlock.
commit 8b918e08da50255cf1486f14a252f4cd46a1c143
Author: Nir Soffer <nsoffer(a)redhat.com>
AuthorDate: Fri Jun 14 21:48:01 2019 +0300
python: Use C99 standard
Using C99 enables useful features[1] is old enough so it should not be a
portability issue.
[1] https://fedoramagazine.org/c99-features-gcc-fedora/
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
python/setup.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/python/setup.py b/python/setup.py
index 369451c..0f3d683 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -11,6 +11,7 @@ sanlock = Extension(name='sanlock',
sources=['sanlock.c'],
include_dirs=['../src'],
library_dirs=['../src'],
+ extra_compile_args=["-std=c99"],
extra_link_args=['-fPIE', '-Wl,-z,relro,-z,now'],
libraries=sanlocklib)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months
[sanlock] 07/14: python: Remove meaningless "All rights reserved"
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
nsoffer pushed a commit to branch master
in repository sanlock.
commit 268116d12fcb89d93e076138d2971655849eae44
Author: Nir Soffer <nsoffer(a)redhat.com>
AuthorDate: Fri Jun 14 20:57:55 2019 +0300
python: Remove meaningless "All rights reserved"
The python extension source does not use this pointless text. Unify the
module docstring to use the same license blob of its source.
For more info why "All rights reserved" is meaningless, see:
https://github.com/libguestfs/nbdkit/commit/952ffe0fc7685ea775ed8879bf0b2...
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
python/sanlock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/sanlock.c b/python/sanlock.c
index 83ecf8a..2216322 100644
--- a/python/sanlock.c
+++ b/python/sanlock.c
@@ -27,7 +27,7 @@ static void set_error(PyObject *exception, const char* format, PyObject* obj);
/* Sanlock module */
PyDoc_STRVAR(pydoc_sanlock, "\
-Copyright (C) 2010-2019 Red Hat, Inc. All rights reserved.\n\
+Copyright (C) 2010-2019 Red Hat, Inc.\n\
This copyrighted material is made available to anyone wishing to use,\n\
modify, copy, or redistribute it subject to the terms and conditions\n\
of the GNU General Public License v2 or (at your option) any later version.");
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months
[sanlock] 06/14: python: Add missing license blob to python files
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
nsoffer pushed a commit to branch master
in repository sanlock.
commit d4964826f5dcd2dc8aa4527acb516acdf24a512b
Author: Nir Soffer <nsoffer(a)redhat.com>
AuthorDate: Fri Jun 14 20:51:53 2019 +0300
python: Add missing license blob to python files
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
python/example.py | 7 +++++++
tests/conftest.py | 6 ++++++
tests/constants.py | 6 ++++++
tests/daemon_test.py | 6 ++++++
tests/direct_test.py | 6 ++++++
tests/python_test.py | 6 ++++++
tests/storage.py | 6 ++++++
tests/units.py | 6 ++++++
tests/util.py | 6 ++++++
9 files changed, 55 insertions(+)
diff --git a/python/example.py b/python/example.py
index 35d39f5..bec9309 100644
--- a/python/example.py
+++ b/python/example.py
@@ -1,3 +1,10 @@
+# Copyright (C) 2019 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
from __future__ import print_function
import pwd
diff --git a/tests/conftest.py b/tests/conftest.py
index 868ae46..b40852b 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,3 +1,9 @@
+# Copyright (C) 2019 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
"""
Fixtures for sanlock testing.
"""
diff --git a/tests/constants.py b/tests/constants.py
index 21089b8..3d9c332 100644
--- a/tests/constants.py
+++ b/tests/constants.py
@@ -1,3 +1,9 @@
+# Copyright (C) 2019 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
"""
Constants copied from sanlock source.
"""
diff --git a/tests/daemon_test.py b/tests/daemon_test.py
index 413ce95..1b484f2 100644
--- a/tests/daemon_test.py
+++ b/tests/daemon_test.py
@@ -1,3 +1,9 @@
+# Copyright (C) 2019 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
"""
Test sanlock client operations.
"""
diff --git a/tests/direct_test.py b/tests/direct_test.py
index 339ef51..579f228 100644
--- a/tests/direct_test.py
+++ b/tests/direct_test.py
@@ -1,3 +1,9 @@
+# Copyright (C) 2019 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
"""
Test sanlock direct options.
"""
diff --git a/tests/python_test.py b/tests/python_test.py
index 331e901..0f70a6a 100644
--- a/tests/python_test.py
+++ b/tests/python_test.py
@@ -1,3 +1,9 @@
+# Copyright (C) 2019 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
"""
Test sanlock python binding with sanlock daemon.
"""
diff --git a/tests/storage.py b/tests/storage.py
index b7fcb2a..0fe6f56 100644
--- a/tests/storage.py
+++ b/tests/storage.py
@@ -1,3 +1,9 @@
+# Copyright (C) 2019 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
"""
storage - provide storage for sanlock tests.
"""
diff --git a/tests/units.py b/tests/units.py
index b47d668..166bff5 100644
--- a/tests/units.py
+++ b/tests/units.py
@@ -1,3 +1,9 @@
+# Copyright (C) 2019 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
"""
Constants for file/disk sizes.
"""
diff --git a/tests/util.py b/tests/util.py
index 6a648c4..12f2702 100644
--- a/tests/util.py
+++ b/tests/util.py
@@ -1,3 +1,9 @@
+# Copyright (C) 2019 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
"""
Testing utilities
"""
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months
[sanlock] 05/14: python: Fix copyright years
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
nsoffer pushed a commit to branch master
in repository sanlock.
commit 4727ba0f868a4b7532a3c74cbe839e20054fb7d3
Author: Nir Soffer <nsoffer(a)redhat.com>
AuthorDate: Fri Jun 14 20:43:36 2019 +0300
python: Fix copyright years
Fix the years range in the python extension and python files license
blob.
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
python/sanlock.c | 4 ++--
python/setup.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/python/sanlock.c b/python/sanlock.c
index c44fee7..83ecf8a 100644
--- a/python/sanlock.c
+++ b/python/sanlock.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Red Hat, Inc.
+ * Copyright 2010-2019 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
@@ -27,7 +27,7 @@ static void set_error(PyObject *exception, const char* format, PyObject* obj);
/* Sanlock module */
PyDoc_STRVAR(pydoc_sanlock, "\
-Copyright (C) 2010-2011 Red Hat, Inc. All rights reserved.\n\
+Copyright (C) 2010-2019 Red Hat, Inc. All rights reserved.\n\
This copyrighted material is made available to anyone wishing to use,\n\
modify, copy, or redistribute it subject to the terms and conditions\n\
of the GNU General Public License v2 or (at your option) any later version.");
diff --git a/python/setup.py b/python/setup.py
index 91311a8..369451c 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Red Hat, Inc.
+# Copyright 2010-2019 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months
[sanlock] 04/14: python: Rename __hosts_to_list to hosts_to_list
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
nsoffer pushed a commit to branch master
in repository sanlock.
commit de6df0eda3644a9f5da50c9b025c469269d2fe1b
Author: Nir Soffer <nsoffer(a)redhat.com>
AuthorDate: Fri Jun 14 21:27:46 2019 +0300
python: Rename __hosts_to_list to hosts_to_list
Underscore prefix is reserved for the compiler and standard library so
we should not use it for our helpers.
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
python/sanlock.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/python/sanlock.c b/python/sanlock.c
index 4155b51..c44fee7 100644
--- a/python/sanlock.c
+++ b/python/sanlock.c
@@ -269,7 +269,7 @@ set_error(PyObject* exception, const char* format, PyObject* obj)
}
static PyObject *
-__hosts_to_list(struct sanlk_host *hss, int hss_count)
+hosts_to_list(struct sanlk_host *hss, int hss_count)
{
int i;
PyObject *ls_list = NULL, *ls_entry = NULL;
@@ -1073,7 +1073,7 @@ py_get_hosts(PyObject *self __unused, PyObject *args, PyObject *keywds)
goto finally;
}
- ls_list = __hosts_to_list(hss, hss_count);
+ ls_list = hosts_to_list(hss, hss_count);
finally:
Py_XDECREF(lockspace);
@@ -1339,7 +1339,7 @@ py_read_resource_owners(PyObject *self __unused, PyObject *args, PyObject *keywd
goto finally;
}
- ls_list = __hosts_to_list(hss, hss_count);
+ ls_list = hosts_to_list(hss, hss_count);
finally:
Py_XDECREF(lockspace);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months