Skip to content

Commit

Permalink
Fix global dry_run check (nornir-automation#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
ogenstad authored and dbarrosop committed Aug 8, 2019
1 parent 4dc846f commit 2fa6d4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nornir/plugins/tasks/version_control/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pathlib import Path
from typing import Tuple

from nornir.core.task import Result, Task
from nornir.core.task import Optional, Result, Task

import requests

Expand Down Expand Up @@ -160,7 +160,7 @@ def gitlab(
filename: str,
content: str = "",
action: str = "create",
dry_run: bool = False,
dry_run: Optional[bool] = None,
branch: str = "master",
destination: str = "",
ref: str = "master",
Expand Down Expand Up @@ -199,7 +199,7 @@ def gitlab(
* diff (``str``): unified diff
"""
dry_run = task.is_dry_run(dry_run)
dry_run = dry_run if dry_run is not None else task.is_dry_run()

session = requests.session()
session.headers.update({"PRIVATE-TOKEN": token})
Expand Down

0 comments on commit 2fa6d4d

Please sign in to comment.